Browse Source

Add additional userland interfaces for setting close-on-exec on fds

when creating them: mkostemp(), mkostemps(), the 'e' mode letter for
fopen(), freopen(), fdopen(), and popen().  The close-on-exec flag will
be cleared by the action created by posix_spawn_file_actions_adddup2().
Also, add support for the C11 'x' mode letter for fopen() and freopen(),
setting O_EXCL when possibly creating files.
Note: this requires kernel support for pipe2() and dup3()!
ok millert@
OPENBSD_5_7
guenther 9 years ago
parent
commit
579f41f3b3
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      src/include/stdlib.h

+ 9
- 1
src/include/stdlib.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: stdlib.h,v 1.59 2014/07/09 16:57:49 beck Exp $ */
/* $OpenBSD: stdlib.h,v 1.60 2014/08/31 02:21:18 guenther Exp $ */
/* $NetBSD: stdlib.h,v 1.25 1995/12/27 21:19:08 jtc Exp $ */
/*-
@ -256,6 +256,13 @@ char *mkdtemp(char *);
int getsubopt(char **, char * const *, char **);
#endif
/*
* The Open Group Base Specifications, post-Issue 7
*/
#if __BSD_VISIBLE
int mkostemp(char *, int);
#endif
#if __BSD_VISIBLE
void *alloca(size_t);
@ -285,6 +292,7 @@ void setprogname(const char *);
extern char *suboptarg; /* getsubopt(3) external variable */
int mkstemps(char *, int);
int mkostemps(char *, int, int);
int heapsort(void *, size_t, size_t, int (*)(const void *, const void *));
int mergesort(void *, size_t, size_t, int (*)(const void *, const void *));


Loading…
Cancel
Save