mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-30 08:40:07 +00:00
cbf0489bcf
* include/fcntl.h: Declare __have_o_cloexec. * io/have_o_cloexec.c: New file. * sysdeps/unix/opendir.c (__opendir): Use O_CLOEXEC is available. (__alloc_dir): If O_CLOEXEC has been used, don't duplicate the fcntl call if not necessary. * login/utmp_file.c (setutent_file): Use __have_o_cloexec instead of local variable.
49 lines
1.7 KiB
C
49 lines
1.7 KiB
C
#ifndef _FCNTL_H
|
|
#include <io/fcntl.h>
|
|
|
|
/* Now define the internal interfaces. */
|
|
extern int __open64 (__const char *__file, int __oflag, ...);
|
|
libc_hidden_proto (__open64)
|
|
extern int __libc_open64 (const char *file, int oflag, ...);
|
|
extern int __libc_open (const char *file, int oflag, ...);
|
|
libc_hidden_proto (__libc_open)
|
|
extern int __libc_creat (const char *file, mode_t mode);
|
|
extern int __libc_fcntl (int fd, int cmd, ...);
|
|
#ifndef NO_CANCELLATION
|
|
extern int __fcntl_nocancel (int fd, int cmd, ...) attribute_hidden;
|
|
libc_hidden_proto (__libc_fcntl)
|
|
#endif
|
|
extern int __open (__const char *__file, int __oflag, ...);
|
|
libc_hidden_proto (__open)
|
|
extern int __fcntl (int __fd, int __cmd, ...);
|
|
libc_hidden_proto (__fcntl)
|
|
extern int __openat (int __fd, __const char *__file, int __oflag, ...)
|
|
__nonnull ((2));
|
|
libc_hidden_proto (__openat)
|
|
extern int __openat64 (int __fd, __const char *__file, int __oflag, ...)
|
|
__nonnull ((2));
|
|
libc_hidden_proto (__openat64)
|
|
|
|
extern int __open_2 (__const char *__path, int __oflag);
|
|
extern int __open64_2 (__const char *__path, int __oflag);
|
|
extern int __openat_2 (int __fd, __const char *__path, int __oflag);
|
|
extern int __openat64_2 (int __fd, __const char *__path, int __oflag);
|
|
|
|
|
|
/* Helper functions for the various *at functions. For Linux. */
|
|
extern void __atfct_seterrno (int errval, int fd, const char *buf)
|
|
attribute_hidden;
|
|
extern void __atfct_seterrno_2 (int errval, int fd1, const char *buf1,
|
|
int fd2, const char *buf2)
|
|
attribute_hidden;
|
|
|
|
|
|
/* Flag determining whether the *at system calls are available. */
|
|
extern int __have_atfcts attribute_hidden;
|
|
|
|
#ifdef O_CLOEXEC
|
|
extern int __have_o_cloexec attribute_hidden;
|
|
#endif
|
|
|
|
#endif
|