Print this page
Build fixes.
code review feeback, close open comment
Ensured various XPG7 stuff are declared properly in sys/stat.h (and cleanup)
New documentation for wcslen, wcsnlen, wcscasecmp (and friends), wcsdup.
Various other tweaks and markup improvements.

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/stat.h
          +++ new/usr/src/uts/common/sys/stat.h
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
       24 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
  24   25   */
  25   26  
  26   27  /*      Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */
  27   28  /*      Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T   */
  28   29  /*      All Rights Reserved     */
  29   30  
  30   31  #ifndef _SYS_STAT_H
  31   32  #define _SYS_STAT_H
  32   33  
  33   34  #include <sys/feature_tests.h>
↓ open down ↓ 429 lines elided ↑ open up ↑
 463  464   * the i386 ABI need to be aware of this too.
 464  465   */
 465  466  
 466  467  #define _R3_MKNOD_VER   1       /* SVR3.0 mknod */
 467  468  #define _MKNOD_VER      2       /* current version of mknod */
 468  469  #define _R3_STAT_VER    1       /* SVR3.0 stat */
 469  470  #define _STAT_VER       2       /* current version of stat */
 470  471  
 471  472  #endif  /* __i386 || (__i386_COMPAT && _KERNEL) */
 472  473  
 473      -#if defined(__EXTENSIONS__) || \
 474      -        (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
 475      -        /* || defined(_XPG7) */
 476      -/* for use with futimens() and utimensat() */
      474 +#if defined(_XPG7) || !defined(_STRICT_SYMBOLS)
 477  475  #define UTIME_NOW       -1L
 478  476  #define UTIME_OMIT      -2L
 479      -#endif  /* defined(__EXTENSIONS__) ... */
      477 +#endif
 480  478  
 481  479  #if !defined(_KERNEL) || defined(_BOOT)
 482  480  
 483      -#if defined(__STDC__)
 484      -
 485  481  #if !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2) || \
 486  482          defined(_XPG4_2) || defined(__EXTENSIONS__)
 487  483  extern int fchmod(int, mode_t);
 488  484  #endif /* !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2)... */
 489  485  
 490  486  extern int chmod(const char *, mode_t);
 491  487  extern int mkdir(const char *, mode_t);
 492  488  extern int mkfifo(const char *, mode_t);
 493  489  extern mode_t umask(mode_t);
 494  490  
↓ open down ↓ 2 lines elided ↑ open up ↑
 497  493              !defined(__PRAGMA_REDEFINE_EXTNAME))
 498  494  extern int fstat64(int, struct stat64 *);
 499  495  extern int stat64(const char *_RESTRICT_KYWD, struct stat64 *_RESTRICT_KYWD);
 500  496  extern int lstat64(const char *_RESTRICT_KYWD, struct stat64 *_RESTRICT_KYWD);
 501  497  #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) || \
 502  498          defined(_ATFILE_SOURCE)
 503  499  extern int fstatat64(int, const char *, struct stat64 *, int);
 504  500  #endif /* defined (_ATFILE_SOURCE) */
 505  501  #endif
 506  502  
 507      -#if defined(__EXTENSIONS__) || defined(_ATFILE_SOURCE) || \
 508      -        (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
 509      -        /* || defined(_XPG7) */
      503 +#if defined(_XPG7) || defined(_ATFILE_SOURCE) || !defined(_STRICT_SYMBOLS)
 510  504  extern int mkdirat(int, const char *, mode_t);
 511  505  extern int mkfifoat(int, const char *, mode_t);
 512  506  extern int mknodat(int, const char *, mode_t, dev_t);
 513  507  extern int fchmodat(int, const char *, mode_t, int);
      508 +#endif
      509 +
      510 +#if defined(_XPG7) || !defined(_STRICT_SYMBOLS)
 514  511  extern int futimens(int, const struct timespec[2]);
 515  512  extern int utimensat(int, const char *, const struct timespec[2], int);
 516      -#endif  /* defined(__EXTENSIONS__) ... */
 517      -
 518      -#else /* !__STDC__ */
 519      -
 520      -#if !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2) || \
 521      -        defined(_XPG4_2) || defined(__EXTENSIONS__)
 522      -extern int fchmod();
 523      -#endif /* !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2)... */
 524      -
 525      -extern int chmod();
 526      -extern int mkdir();
 527      -extern int mkfifo();
 528      -extern mode_t umask();
 529      -
 530      -/* transitional large file interfaces */
 531      -#if     defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
 532      -            !defined(__PRAGMA_REDEFINE_EXTNAME))
 533      -extern int fstat64();
 534      -extern int stat64();
 535      -extern int lstat64();
 536      -#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) || \
 537      -        defined(_ATFILE_SOURCE)
 538      -extern int fstatat64();
 539      -#endif /* defined (_ATFILE_SOURCE) */
 540  513  #endif
 541  514  
 542      -#if defined(__EXTENSIONS__) || defined(_ATFILE_SOURCE) || \
 543      -        (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
 544      -        /* || defined(_XPG7) */
 545      -extern int mkdirat();
 546      -extern int mkfifoat();
 547      -extern int mknodat();
 548      -extern int fchmodat();
 549      -extern int futimens();
 550      -extern int utimensat();
 551      -#endif  /* defined(__EXTENSIONS__) ... */
 552      -
 553      -#endif /* defined(__STDC__) */
 554      -
 555  515  #include <sys/stat_impl.h>
 556  516  
 557  517  #endif /* !defined(_KERNEL) */
 558  518  
 559  519  #ifdef  __cplusplus
 560  520  }
 561  521  #endif
 562  522  
 563  523  #endif  /* _SYS_STAT_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX