Define O_TTY_INIT (POSIX 2008)

Issue #90 resolved
Garrett D'Amore repo owner created an issue

POSIX 2008 defines a new open flag, O_TTY_INIT. This can be zero valued, but check the specification for details.

Comments (3)

  1. Garrett D'Amore reporter
    diff --git a/usr/src/test/libc-tests/cfg/symbols/fcntl_h.cfg b/usr/src/test/libc-tests/cfg/symbols/fcntl_h.cfg
    index 5ae3062..616030e 100644
    --- a/usr/src/test/libc-tests/cfg/symbols/fcntl_h.cfg
    +++ b/usr/src/test/libc-tests/cfg/symbols/fcntl_h.cfg
    @@ -33,6 +33,23 @@ value | AT_FDCWD | int | fcntl.h | -ALL SUSv4+
     value | AT_REMOVEDIR | int | fcntl.h | -ALL SUSv4+ 
     value | AT_SYMLINK_NOFOLLOW | int | fcntl.h | -ALL SUSv4+ 
     value | AT_SYMLINK_FOLLOW | int | fcntl.h | -ALL SUSv4+ 
    +value | O_ACCMODE | int | fcntl.h | POSIX+ SUS+
    +value | O_APPEND | int | fcntl.h | POSIX+ SUS+
    +value | O_CLOEXEC | int | fcntl.h | POSIX+ SUS+
    +value | O_CREAT | int | fcntl.h | POSIX+ SUS+
    +value | O_DSYNC | int | fcntl.h | XPG3+ POSIX-1993+
    +value | O_EXCL | int | fcntl.h | POSIX+ SUS+
    +value | O_EXEC | int | fcntl.h | SUSv4+
    +value | O_NDELAY | int | fcntl.h | -POSIX-1993+
    +value | O_NOCTTY | int | fcntl.h | POSIX+ SUS+
    +value | O_NONBLOCK | int | fcntl.h | POSIX+ SUS+
    +value | O_RDONLY | int | fcntl.h | POSIX+ SUS+
    +value | O_RDWR | int | fcntl.h | POSIX+ SUS+
    +value | O_RSYNC | int | fcntl.h | XPG3+ POSIX-1993+
    +value | O_SEARCH | int | fcntl.h | SUSv4+
    +value | O_SYNC | int | fcntl.h | XPG3+ POSIX-1993+
    +value | O_TTY_INIT | int | fcntl.h | -ALL SUSv4+
    +value | O_WRONLY | int | fcntl.h | POSIX+ SUS+
    
     #
     # Functions
    diff --git a/usr/src/uts/common/sys/fcntl.h b/usr/src/uts/common/sys/fcntl.h
    index 88cec37..48d0e5d 100644
    --- a/usr/src/uts/common/sys/fcntl.h
    +++ b/usr/src/uts/common/sys/fcntl.h
    @@ -87,6 +87,9 @@ extern "C" {
     #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 */
    +#if defined(_XPG7) || !defined(_STRICT_SYMBOLS)
    +#define    O_TTY_INIT  0   /* ttys are always opened conforming */
    +#endif
    
     /*
      * fcntl(2) requests
    
  2. Garrett D'Amore reporter

    So ttys on illumos/Solaris are always opened in conforming mode, so we can use O_TTY_INIT == 0.

  3. Log in to comment