mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-02 09:01:39 -05:00
os: wrap F_DUPFD_CLOEXEC
Some system C libraries do not have F_DUPFD_CLOEXEC. Provide a fallback. Add tests for the new wl_os_dupfd_cloexec() wrapper. Add per-wrapper call counters in os_wrappers-test.c. Makes it easier to determine the minimum required number of wrapped calls. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
This commit is contained in:
parent
3b29783dc8
commit
1463a41f89
4 changed files with 91 additions and 4 deletions
|
|
@ -26,6 +26,9 @@
|
|||
int
|
||||
wl_os_socket_cloexec(int domain, int type, int protocol);
|
||||
|
||||
int
|
||||
wl_os_dupfd_cloexec(int fd, long minfd);
|
||||
|
||||
/*
|
||||
* The following are for wayland-os.c and the unit tests.
|
||||
* Do not use them elsewhere.
|
||||
|
|
@ -37,6 +40,10 @@ wl_os_socket_cloexec(int domain, int type, int protocol);
|
|||
#define SOCK_CLOEXEC 02000000
|
||||
#endif
|
||||
|
||||
#ifndef F_DUPFD_CLOEXEC
|
||||
#define F_DUPFD_CLOEXEC 1030
|
||||
#endif
|
||||
|
||||
#endif /* __linux__ */
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue