Print this page
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>
*** 22,31 ****
--- 22,32 ----
/*
* Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012 by Delphix. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
*** 1916,1926 ****
}
#define ALL_O_FLAGS \
(O_NDELAY|O_APPEND|O_SYNC|O_DSYNC|O_NONBLOCK|O_CREAT|O_TRUNC\
|O_EXCL|O_NOCTTY|O_LARGEFILE|O_RSYNC|O_XATTR|O_NOFOLLOW|O_NOLINKS\
! |FXATTRDIROPEN)
const char *
openarg(private_t *pri, int arg)
{
char *str = pri->code_buf;
--- 1917,1927 ----
}
#define ALL_O_FLAGS \
(O_NDELAY|O_APPEND|O_SYNC|O_DSYNC|O_NONBLOCK|O_CREAT|O_TRUNC\
|O_EXCL|O_NOCTTY|O_LARGEFILE|O_RSYNC|O_XATTR|O_NOFOLLOW|O_NOLINKS\
! |O_CLOEXEC|FXATTRDIROPEN)
const char *
openarg(private_t *pri, int arg)
{
char *str = pri->code_buf;
*** 1974,1983 ****
--- 1975,1986 ----
(void) strlcat(str, "|O_XATTR", sizeof (pri->code_buf));
if (arg & O_NOFOLLOW)
(void) strlcat(str, "|O_NOFOLLOW", sizeof (pri->code_buf));
if (arg & O_NOLINKS)
(void) strlcat(str, "|O_NOLINKS", sizeof (pri->code_buf));
+ if (arg & O_CLOEXEC)
+ (void) strlcat(str, "|O_CLOEXEC", sizeof (pri->code_buf));
if (arg & FXATTRDIROPEN)
(void) strlcat(str, "|FXATTRDIROPEN", sizeof (pri->code_buf));
return ((const char *)str);
}