3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
24 */
25
26 /* Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */
27 /* Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T */
28 /* All Rights Reserved */
29
30 #ifndef _SYS_STAT_H
31 #define _SYS_STAT_H
32
33 #include <sys/feature_tests.h>
34 #include <sys/types.h>
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 /*
41 * The implementation specific header <sys/time_impl.h> includes a
42 * definition for timestruc_t needed by the stat structure. However,
463 * the i386 ABI need to be aware of this too.
464 */
465
466 #define _R3_MKNOD_VER 1 /* SVR3.0 mknod */
467 #define _MKNOD_VER 2 /* current version of mknod */
468 #define _R3_STAT_VER 1 /* SVR3.0 stat */
469 #define _STAT_VER 2 /* current version of stat */
470
471 #endif /* __i386 || (__i386_COMPAT && _KERNEL) */
472
473 #if defined(__EXTENSIONS__) || \
474 (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
475 /* || defined(_XPG7) */
476 /* for use with futimens() and utimensat() */
477 #define UTIME_NOW -1L
478 #define UTIME_OMIT -2L
479 #endif /* defined(__EXTENSIONS__) ... */
480
481 #if !defined(_KERNEL) || defined(_BOOT)
482
483 #if defined(__STDC__)
484
485 #if !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2) || \
486 defined(_XPG4_2) || defined(__EXTENSIONS__)
487 extern int fchmod(int, mode_t);
488 #endif /* !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2)... */
489
490 extern int chmod(const char *, mode_t);
491 extern int mkdir(const char *, mode_t);
492 extern int mkfifo(const char *, mode_t);
493 extern mode_t umask(mode_t);
494
495 /* transitional large file interfaces */
496 #if defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
497 !defined(__PRAGMA_REDEFINE_EXTNAME))
498 extern int fstat64(int, struct stat64 *);
499 extern int stat64(const char *_RESTRICT_KYWD, struct stat64 *_RESTRICT_KYWD);
500 extern int lstat64(const char *_RESTRICT_KYWD, struct stat64 *_RESTRICT_KYWD);
501 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) || \
502 defined(_ATFILE_SOURCE)
503 extern int fstatat64(int, const char *, struct stat64 *, int);
504 #endif /* defined (_ATFILE_SOURCE) */
505 #endif
506
507 #if defined(__EXTENSIONS__) || defined(_ATFILE_SOURCE) || \
508 (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
509 /* || defined(_XPG7) */
510 extern int mkdirat(int, const char *, mode_t);
511 extern int mkfifoat(int, const char *, mode_t);
512 extern int mknodat(int, const char *, mode_t, dev_t);
513 extern int fchmodat(int, const char *, mode_t, int);
514 extern int futimens(int, const struct timespec[2]);
515 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 #endif
541
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 #include <sys/stat_impl.h>
556
557 #endif /* !defined(_KERNEL) */
558
559 #ifdef __cplusplus
560 }
561 #endif
562
563 #endif /* _SYS_STAT_H */
|
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
25 */
26
27 /* Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */
28 /* Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T */
29 /* All Rights Reserved */
30
31 #ifndef _SYS_STAT_H
32 #define _SYS_STAT_H
33
34 #include <sys/feature_tests.h>
35 #include <sys/types.h>
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41 /*
42 * The implementation specific header <sys/time_impl.h> includes a
43 * definition for timestruc_t needed by the stat structure. However,
464 * the i386 ABI need to be aware of this too.
465 */
466
467 #define _R3_MKNOD_VER 1 /* SVR3.0 mknod */
468 #define _MKNOD_VER 2 /* current version of mknod */
469 #define _R3_STAT_VER 1 /* SVR3.0 stat */
470 #define _STAT_VER 2 /* current version of stat */
471
472 #endif /* __i386 || (__i386_COMPAT && _KERNEL) */
473
474 #if defined(__EXTENSIONS__) || \
475 (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
476 /* || defined(_XPG7) */
477 /* for use with futimens() and utimensat() */
478 #define UTIME_NOW -1L
479 #define UTIME_OMIT -2L
480 #endif /* defined(__EXTENSIONS__) ... */
481
482 #if !defined(_KERNEL) || defined(_BOOT)
483
484 #if !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2) || \
485 defined(_XPG4_2) || defined(__EXTENSIONS__)
486 extern int fchmod(int, mode_t);
487 #endif /* !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2)... */
488
489 extern int chmod(const char *, mode_t);
490 extern int mkdir(const char *, mode_t);
491 extern int mkfifo(const char *, mode_t);
492 extern mode_t umask(mode_t);
493
494 /* transitional large file interfaces */
495 #if defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
496 !defined(__PRAGMA_REDEFINE_EXTNAME))
497 extern int fstat64(int, struct stat64 *);
498 extern int stat64(const char *_RESTRICT_KYWD, struct stat64 *_RESTRICT_KYWD);
499 extern int lstat64(const char *_RESTRICT_KYWD, struct stat64 *_RESTRICT_KYWD);
500 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) || \
501 defined(_ATFILE_SOURCE)
502 extern int fstatat64(int, const char *, struct stat64 *, int);
503 #endif /* defined (_ATFILE_SOURCE) */
504 #endif
505
506 #if defined(__EXTENSIONS__) || defined(_ATFILE_SOURCE) || \
507 (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
508 /* || defined(_XPG7) */
509 extern int mkdirat(int, const char *, mode_t);
510 extern int mkfifoat(int, const char *, mode_t);
511 extern int mknodat(int, const char *, mode_t, dev_t);
512 extern int fchmodat(int, const char *, mode_t, int);
513 extern int futimens(int, const struct timespec[2]);
514 extern int utimensat(int, const char *, const struct timespec[2], int);
515 #endif /* defined(__EXTENSIONS__) ... */
516
517 #include <sys/stat_impl.h>
518
519 #endif /* !defined(_KERNEL) */
520
521 #ifdef __cplusplus
522 }
523 #endif
524
525 #endif /* _SYS_STAT_H */
|