diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2013-04-04 11:46:15 +0000 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2013-04-04 11:46:15 +0000 |
commit | c78259c9a0caefff0b3e7bb7d102c13e91e3eb10 (patch) | |
tree | 7c039123285f47a95a36f17e4e2c44b5572a1f57 /uts | |
parent | 7aec2201abdb7eeedc2a90379de11ceeba45539d (diff) | |
download | illumos-packaging-c78259c9a0caefff0b3e7bb7d102c13e91e3eb10.tar.gz |
illumos #3665: Implement O_CLOEXEC as an open() flag
Diffstat (limited to 'uts')
-rw-r--r-- | uts/debian/changelog | 1 | ||||
-rw-r--r-- | uts/debian/patches/illumos-3665-O_CLOEXEC.patch | 87 | ||||
-rw-r--r-- | uts/debian/patches/series | 1 |
3 files changed, 89 insertions, 0 deletions
diff --git a/uts/debian/changelog b/uts/debian/changelog index e489b88..90e557a 100644 --- a/uts/debian/changelog +++ b/uts/debian/changelog @@ -9,6 +9,7 @@ uts (2.10-3) UNRELEASED; urgency=low * Fix sys/types.h to include features.h in userspace * Disable checking for standard conformance if defined __EXTENSIONS__ or _GNU_SOURCE + * illumos feature #3665: Implement O_CLOEXEC as an open() flag -- Igor Pashev <pashev.igor@gmail.com> Fri, 08 Mar 2013 01:28:48 +0000 diff --git a/uts/debian/patches/illumos-3665-O_CLOEXEC.patch b/uts/debian/patches/illumos-3665-O_CLOEXEC.patch new file mode 100644 index 0000000..bb6d488 --- /dev/null +++ b/uts/debian/patches/illumos-3665-O_CLOEXEC.patch @@ -0,0 +1,87 @@ +commit b075ad5b007248d50e4c2e838b460c9c7cfd9fad +Author: Theo Schlossnagle <jesus@omniti.com> +Date: Sun Mar 31 04:00:15 2013 +0000 + + 3665 Implement O_CLOEXEC as an open() flag + Reviewed by: Robert Mustacchi <rm@joyent.com> + Reviewed by: Gordon Ross <gwr@nexenta.com> + Reviewed by: Dan McDonald <danmcd@nexenta.com> + Approved by: Richard Lowe <richlowe@richlowe.net> + +Index: uts/usr/src/uts/common/sys/fcntl.h +=================================================================== +--- uts.orig/usr/src/uts/common/sys/fcntl.h 2012-10-08 00:25:59.000000000 +0000 ++++ uts/usr/src/uts/common/sys/fcntl.h 2013-04-04 11:45:11.054250931 +0000 +@@ -36,6 +36,8 @@ + * contributors. + */ + ++/* Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. */ ++ + #ifndef _SYS_FCNTL_H + #define _SYS_FCNTL_H + +@@ -82,6 +84,7 @@ + #define O_XATTR 0x4000 /* extended attribute */ + #define O_NOFOLLOW 0x20000 /* don't follow symlinks */ + #define O_NOLINKS 0x40000 /* don't allow multiple hard links */ ++#define O_CLOEXEC 0x800000 /* set the close-on-exec flag */ + + /* + * fcntl(2) requests +Index: uts/usr/src/uts/common/sys/file.h +=================================================================== +--- uts.orig/usr/src/uts/common/sys/file.h 2013-03-30 20:42:51.340692366 +0000 ++++ uts/usr/src/uts/common/sys/file.h 2013-04-04 11:45:11.074684953 +0000 +@@ -26,6 +26,8 @@ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ + /* All Rights Reserved */ + ++/* Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. */ ++ + #ifndef _SYS_FILE_H + #define _SYS_FILE_H + +@@ -131,6 +133,8 @@ + extern int flock(int, int); + #endif + ++#define FCLOEXEC 0x800000 /* O_CLOEXEC = 0x800000 */ ++ + #ifdef _KERNEL + + /* +Index: uts/usr/src/uts/common/syscall/open.c +=================================================================== +--- uts.orig/usr/src/uts/common/syscall/open.c 2012-10-08 00:26:00.000000000 +0000 ++++ uts/usr/src/uts/common/syscall/open.c 2013-04-04 11:45:11.102327744 +0000 +@@ -27,6 +27,9 @@ + /* All Rights Reserved */ + + /* ++ * Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. ++ */ ++/* + * Portions of this source code were derived from Berkeley 4.3 BSD + * under license from the Regents of the University of California. + */ +@@ -226,6 +229,9 @@ + * falloc reserved. + */ + setf(fd, fp); ++ if ((filemode & FCLOEXEC) != 0) { ++ f_setfd(fd, FD_CLOEXEC); ++ } + return (fd); + } else { + /* +@@ -252,6 +258,9 @@ + fp->f_count++; + mutex_exit(&fp->f_tlock); + setf(fd, fp); ++ if ((filemode & FCLOEXEC) != 0) { ++ f_setfd(fd, FD_CLOEXEC); ++ } + releasef(dupfd); + } + return (fd); diff --git a/uts/debian/patches/series b/uts/debian/patches/series index 1373bcd..a9d108e 100644 --- a/uts/debian/patches/series +++ b/uts/debian/patches/series @@ -67,3 +67,4 @@ sysmacros-gnu-compat.patch sys_mman.h-bsd_source.patch boolean_t-guard.patch sys_types.h-includes-features.h.patch +illumos-3665-O_CLOEXEC.patch |