#include "citrus_region.h"
#include "citrus_mmap.h"
-#if defined(__minix) && !defined(O_CLOEXEC)
-#define O_CLOEXEC 0
-#endif
-
int
_citrus_map_file(struct _citrus_region * __restrict r,
const char * __restrict path)
dbp = NULL;
/* Open the user's file -- if this fails, we're done. */
if (fname != NULL) {
-#ifndef O_CLOEXEC
-#define O_CLOEXEC 0
-#endif
if ((rfd = open(fname, flags | O_CLOEXEC, mode)) == -1)
return NULL;
-#if O_CLOEXEC == 0
- if (fcntl(rfd, F_SETFD, FD_CLOEXEC) == -1)
- goto err;
-#endif
}
/* Create a btree in memory (backed by disk). */
* and ".." are all fairly nasty problems. Note, if we can't get the
* descriptor we run anyway, just more slowly.
*/
-#ifndef O_CLOEXEC
-#define O_CLOEXEC 0
-#endif
if (!ISSET(FTS_NOCHDIR)) {
if ((sp->fts_rfd = open(".", O_RDONLY | O_CLOEXEC, 0)) == -1)
SET(FTS_NOCHDIR);
#include <sys/featuretest.h>
#include <sys/types.h>
-#if !defined(O_CLOEXEC)
-#define O_CLOEXEC 0
-#endif
-
#endif
#include "reentrant.h"
#include <sys/cdefs.h>
#include <sys/types.h>
-#if !defined(O_CLOEXEC)
-#define O_CLOEXEC 0
-#endif
-
#endif
#include "extern.h"
if ((fd = open(name, O_RDONLY | O_NONBLOCK | O_CLOEXEC)) == -1)
return NULL;
-#if defined(__minix)
- if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) {
- close(fd);
- return NULL;
- }
-#endif /* defined(__minix) */
return __opendir_common(fd, name, flags);
}
#include "env.h"
#include "reentrant.h"
-#if defined(__minix) && !defined(O_CLOEXEC)
-#define O_CLOEXEC 0
-#endif
-
#ifdef __weak_alias
__weak_alias(popen,_popen)
__weak_alias(pclose,_pclose)
#include "reentrant.h"
#include "local.h"
-#if defined(__minix) && !defined(O_CLOEXEC)
-#define O_CLOEXEC 0
-#endif
-
/*
* Return the (stdio) flags for a given mode. Store the flags
* to be passed to an open() syscall through *optr.
#include <sys/clockctl.h>
-#if defined(__minix) && !defined(O_CLOEXEC)
-#define O_CLOEXEC 0
-#endif
-
extern int __clockctl_fd;
int ____adjtime50(const struct timeval *, struct timeval *);
#include <sys/clockctl.h>
-#if defined(__minix) && !defined(O_CLOEXEC)
-#define O_CLOEXEC 0
-#endif
-
extern int __clockctl_fd;
int ____clock_settime50(clockid_t, const struct timespec *);
__weak_alias(ntp_adjtime,_ntp_adjtime)
#endif
-#if defined(__minix) && !defined(O_CLOEXEC)
-#define O_CLOEXEC 0
-#endif
-
extern int __clockctl_fd;
int __ntp_adjtime(struct timex *);
#include <time.h>
#include <unistd.h>
-#if defined(__minix) && !defined(O_CLOEXEC)
-#define O_CLOEXEC 0
-#endif
-
int __clockctl_fd = -1;
int ____settimeofday50(const struct timeval *, const void *);
filp->filp_count = 1;
filp->filp_vno = vp;
filp->filp_flags = oflags;
+ if (oflags & O_CLOEXEC)
+ FD_SET(scratch(fp).file.fd_nr, &fp->fp_cloexec_set);
/* Only do the normal open code if we didn't just create the file. */
if (exist) {
#define O_REOPEN 010000 /* automatically re-open device after driver
* restart
*/
+#define O_CLOEXEC 020000 /* close on exec */
#ifndef __minix /* NOT SUPPORTED! */