Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Aleksandr Isakov
wine-fonts
Commits
1561a8a2
Commit
1561a8a2
authored
Jul 06, 2020
by
Zebediah Figura
Committed by
Vitaly Lipatov
Jul 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Create eventfd file descriptors for process objects.
parent
c5c10198
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
1 deletion
+35
-1
esync.c
server/esync.c
+18
-0
esync.h
server/esync.h
+1
-0
process.c
server/process.c
+15
-1
process.h
server/process.h
+1
-0
No files found.
server/esync.c
View file @
1561a8a2
...
...
@@ -295,6 +295,24 @@ struct esync *create_esync( struct object *root, const struct unicode_str *name,
#endif
}
/* Create a file descriptor for an existing handle.
* Caller must close the handle when it's done; it's not linked to an esync
* server object in any way. */
int
esync_create_fd
(
int
initval
,
int
flags
)
{
#ifdef HAVE_SYS_EVENTFD_H
int
fd
;
fd
=
eventfd
(
initval
,
flags
|
EFD_CLOEXEC
|
EFD_NONBLOCK
);
if
(
fd
==
-
1
)
perror
(
"eventfd"
);
return
fd
;
#else
return
-
1
;
#endif
}
DECL_HANDLER
(
create_esync
)
{
struct
esync
*
esync
;
...
...
server/esync.h
View file @
1561a8a2
...
...
@@ -22,3 +22,4 @@
extern
int
do_esync
(
void
);
void
esync_init
(
void
);
int
esync_create_fd
(
int
initval
,
int
flags
);
server/process.c
View file @
1561a8a2
...
...
@@ -63,6 +63,7 @@
#include "request.h"
#include "user.h"
#include "security.h"
#include "esync.h"
/* process object */
...
...
@@ -95,6 +96,7 @@ static struct security_descriptor *process_get_sd( struct object *obj );
static
void
process_poll_event
(
struct
fd
*
fd
,
int
event
);
static
struct
list
*
process_get_kernel_obj_list
(
struct
object
*
obj
);
static
void
process_destroy
(
struct
object
*
obj
);
static
int
process_get_esync_fd
(
struct
object
*
obj
,
enum
esync_type
*
type
);
static
void
terminate_process
(
struct
process
*
process
,
struct
thread
*
skip
,
int
exit_code
);
static
const
struct
object_ops
process_ops
=
...
...
@@ -105,7 +107,7 @@ static const struct object_ops process_ops =
add_queue
,
/* add_queue */
remove_queue
,
/* remove_queue */
process_signaled
,
/* signaled */
NULL
,
/* get_esync_fd */
process_get_esync_fd
,
/* get_esync_fd */
no_satisfied
,
/* satisfied */
no_signal
,
/* signal */
no_get_fd
,
/* get_fd */
...
...
@@ -686,6 +688,7 @@ struct process *create_process( int fd, struct process *parent, unsigned int fla
process
->
rawinput_mouse
=
NULL
;
process
->
rawinput_kbd
=
NULL
;
memset
(
&
process
->
image_info
,
0
,
sizeof
(
process
->
image_info
)
);
process
->
esync_fd
=
-
1
;
list_init
(
&
process
->
kernel_object
);
list_init
(
&
process
->
thread_list
);
list_init
(
&
process
->
locks
);
...
...
@@ -742,6 +745,9 @@ struct process *create_process( int fd, struct process *parent, unsigned int fla
if
(
!
token_assign_label
(
process
->
token
,
&
high_label_sid
))
goto
error
;
if
(
do_esync
())
process
->
esync_fd
=
esync_create_fd
(
0
,
0
);
set_fd_events
(
process
->
msg_fd
,
POLLIN
);
/* start listening to events */
return
process
;
...
...
@@ -789,6 +795,7 @@ static void process_destroy( struct object *obj )
free
(
process
->
rawinput_devices
);
free
(
process
->
dir_cache
);
free
(
process
->
image
);
if
(
do_esync
())
close
(
process
->
esync_fd
);
}
/* dump a process on stdout for debugging purposes */
...
...
@@ -806,6 +813,13 @@ static int process_signaled( struct object *obj, struct wait_queue_entry *entry
return
!
process
->
running_threads
;
}
static
int
process_get_esync_fd
(
struct
object
*
obj
,
enum
esync_type
*
type
)
{
struct
process
*
process
=
(
struct
process
*
)
obj
;
*
type
=
ESYNC_MANUAL_SERVER
;
return
process
->
esync_fd
;
}
static
unsigned
int
process_map_access
(
struct
object
*
obj
,
unsigned
int
access
)
{
access
=
default_map_access
(
obj
,
access
);
...
...
server/process.h
View file @
1561a8a2
...
...
@@ -85,6 +85,7 @@ struct process
const
struct
rawinput_device
*
rawinput_kbd
;
/* rawinput keyboard device, if any */
struct
list
kernel_object
;
/* list of kernel object pointers */
pe_image_info_t
image_info
;
/* main exe image info */
int
esync_fd
;
/* esync file descriptor (signaled on exit) */
};
/* process functions */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment