sl@0: /* sl@0: * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: sl@0: #ifndef _SYS_STAT_H sl@0: #define _SYS_STAT_H sl@0: sl@0: #ifdef __cplusplus sl@0: extern "C" { sl@0: #endif sl@0: sl@0: #include <_ansi.h> sl@0: #include sl@0: #include sl@0: sl@0: struct stat sl@0: { sl@0: dev_t st_dev; sl@0: ino_t st_ino; sl@0: mode_t st_mode; sl@0: short st_nlink; sl@0: uid_t st_uid; sl@0: gid_t st_gid; sl@0: dev_t st_rdev; sl@0: off_t st_size; sl@0: /* SysV/sco doesn't have the rest... */ sl@0: #ifdef __svr4__ sl@0: time_t st_atime; sl@0: time_t st_mtime; sl@0: time_t st_ctime; sl@0: #else sl@0: time_t st_atime; sl@0: int st_spare1; sl@0: time_t st_mtime; sl@0: int st_spare2; sl@0: time_t st_ctime; sl@0: int st_spare3; sl@0: long st_blksize; sl@0: long st_blocks; sl@0: long st_spare4[2]; sl@0: #endif sl@0: }; sl@0: sl@0: #define _IFMT 0170000 /* type of file */ sl@0: #define _IFDIR 0040000 /* directory */ sl@0: #define _IFCHR 0020000 /* character special */ sl@0: #define _IFBLK 0060000 /* block special */ sl@0: #define _IFREG 0100000 /* regular */ sl@0: #define _IFLNK 0120000 /* symbolic link */ sl@0: #define _IFSOCK 0140000 /* socket */ sl@0: #define _IFIFO 0010000 /* fifo */ sl@0: sl@0: #define S_BLKSIZE 1024 /* size of a block */ sl@0: sl@0: #define S_ISUID 0004000 /* set user id on execution */ sl@0: #define S_ISGID 0002000 /* set group id on execution */ sl@0: #ifndef _POSIX_SOURCE sl@0: #define S_ISVTX 0001000 /* save swapped text even after use */ sl@0: #define S_IREAD 0000400 /* read permission, owner */ sl@0: #define S_IWRITE 0000200 /* write permission, owner */ sl@0: #define S_IEXEC 0000100 /* execute/search permission, owner */ sl@0: sl@0: #define S_ENFMT 0002000 /* enforcement-mode locking */ sl@0: sl@0: #define S_IFMT _IFMT sl@0: #define S_IFDIR _IFDIR sl@0: #define S_IFCHR _IFCHR sl@0: #define S_IFBLK _IFBLK sl@0: #define S_IFREG _IFREG sl@0: #define S_IFLNK _IFLNK sl@0: #define S_IFSOCK _IFSOCK sl@0: #define S_IFIFO _IFIFO sl@0: #endif /* !_POSIX_SOURCE */ sl@0: sl@0: #define S_IRWXU 0000700 /* rwx, owner */ sl@0: #define S_IRUSR 0000400 /* read permission, owner */ sl@0: #define S_IWUSR 0000200 /* write permission, owner */ sl@0: #define S_IXUSR 0000100 /* execute/search permission, owner */ sl@0: #define S_IRWXG 0000070 /* rwx, group */ sl@0: #define S_IRGRP 0000040 /* read permission, group */ sl@0: #define S_IWGRP 0000020 /* write permission, grougroup */ sl@0: #define S_IXGRP 0000010 /* execute/search permission, group */ sl@0: #define S_IRWXO 0000007 /* rwx, other */ sl@0: #define S_IROTH 0000004 /* read permission, other */ sl@0: #define S_IWOTH 0000002 /* write permission, other */ sl@0: #define S_IXOTH 0000001 /* execute/search permission, other */ sl@0: sl@0: #define S_ISBLK(m) (((m)&_IFMT) == _IFBLK) sl@0: #define S_ISCHR(m) (((m)&_IFMT) == _IFCHR) sl@0: #define S_ISDIR(m) (((m)&_IFMT) == _IFDIR) sl@0: #define S_ISFIFO(m) (((m)&_IFMT) == _IFIFO) sl@0: #define S_ISREG(m) (((m)&_IFMT) == _IFREG) sl@0: #define S_ISLNK(m) (((m)&_IFMT) == _IFLNK) sl@0: #define S_ISSOCK(m) (((m)&_IFMT) == _IFSOCK) sl@0: sl@0: IMPORT_C int chmod ( const char *_path, mode_t _mode ); sl@0: IMPORT_C int wchmod ( const wchar_t *_path, mode_t _mode ); sl@0: IMPORT_C int fstat ( int _fd, struct stat *_sbuf ); sl@0: IMPORT_C int mkdir ( const char *_path, mode_t _mode ); sl@0: IMPORT_C int wmkdir ( const wchar_t *_path, mode_t _mode ); sl@0: IMPORT_C int stat ( const char *_path, struct stat *_sbuf ); sl@0: IMPORT_C int wstat ( const wchar_t *_path, struct stat *_sbuf ); sl@0: IMPORT_C char* realpath (const char *_path, char *resolved); sl@0: IMPORT_C wchar_t* wrealpath (const wchar_t * _path, wchar_t * resolved); sl@0: sl@0: int mkfifo ( char *_path, mode_t _mode ); sl@0: mode_t umask ( mode_t _mask ); sl@0: sl@0: #ifdef __cplusplus sl@0: } sl@0: #endif sl@0: #endif /* _SYS_STAT_H */