os/ossrv/genericopenlibs/cstdlib/LINCSYS/STAT.H
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
/*
sl@0
     2
* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     3
* All rights reserved.
sl@0
     4
* This component and the accompanying materials are made available
sl@0
     5
* under the terms of "Eclipse Public License v1.0"
sl@0
     6
* which accompanies this distribution, and is available
sl@0
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     8
*
sl@0
     9
* Initial Contributors:
sl@0
    10
* Nokia Corporation - initial contribution.
sl@0
    11
*
sl@0
    12
* Contributors:
sl@0
    13
*
sl@0
    14
* Description:
sl@0
    15
*
sl@0
    16
*/
sl@0
    17
sl@0
    18
sl@0
    19
sl@0
    20
/**
sl@0
    21
 @file
sl@0
    22
 @publishedAll
sl@0
    23
 @released
sl@0
    24
*/
sl@0
    25
sl@0
    26
#ifndef	_SYS_STAT_H
sl@0
    27
#define	_SYS_STAT_H
sl@0
    28
sl@0
    29
#ifdef __cplusplus
sl@0
    30
extern "C" {
sl@0
    31
#endif
sl@0
    32
sl@0
    33
#include <_ansi.h>
sl@0
    34
#include <time.h>
sl@0
    35
#include <sys/types.h>
sl@0
    36
sl@0
    37
struct	stat 
sl@0
    38
{
sl@0
    39
  dev_t		st_dev;
sl@0
    40
  ino_t		st_ino;
sl@0
    41
  mode_t	st_mode;
sl@0
    42
  short		st_nlink;
sl@0
    43
  uid_t		st_uid;
sl@0
    44
  gid_t		st_gid;
sl@0
    45
  dev_t		st_rdev;
sl@0
    46
  off_t		st_size;
sl@0
    47
  /* SysV/sco doesn't have the rest... */
sl@0
    48
#ifdef __svr4__
sl@0
    49
  time_t	st_atime;
sl@0
    50
  time_t	st_mtime;
sl@0
    51
  time_t	st_ctime;
sl@0
    52
#else
sl@0
    53
  time_t	st_atime;
sl@0
    54
  int	st_spare1;
sl@0
    55
  time_t	st_mtime;
sl@0
    56
  int	st_spare2;
sl@0
    57
  time_t	st_ctime;
sl@0
    58
  int	st_spare3;
sl@0
    59
  long		st_blksize;
sl@0
    60
  long		st_blocks;
sl@0
    61
  long	st_spare4[2];
sl@0
    62
#endif
sl@0
    63
};
sl@0
    64
sl@0
    65
#define	_IFMT		0170000	/* type of file */
sl@0
    66
#define		_IFDIR	0040000	/* directory */
sl@0
    67
#define		_IFCHR	0020000	/* character special */
sl@0
    68
#define		_IFBLK	0060000	/* block special */
sl@0
    69
#define		_IFREG	0100000	/* regular */
sl@0
    70
#define		_IFLNK	0120000	/* symbolic link */
sl@0
    71
#define		_IFSOCK	0140000	/* socket */
sl@0
    72
#define		_IFIFO	0010000	/* fifo */
sl@0
    73
sl@0
    74
#define 	S_BLKSIZE  1024 /* size of a block */
sl@0
    75
sl@0
    76
#define	S_ISUID		0004000	/* set user id on execution */
sl@0
    77
#define	S_ISGID		0002000	/* set group id on execution */
sl@0
    78
#ifndef	_POSIX_SOURCE
sl@0
    79
#define	S_ISVTX		0001000	/* save swapped text even after use */
sl@0
    80
#define	S_IREAD		0000400	/* read permission, owner */
sl@0
    81
#define	S_IWRITE 	0000200	/* write permission, owner */
sl@0
    82
#define	S_IEXEC		0000100	/* execute/search permission, owner */
sl@0
    83
sl@0
    84
#define	S_ENFMT 	0002000	/* enforcement-mode locking */
sl@0
    85
sl@0
    86
#define	S_IFMT		_IFMT
sl@0
    87
#define	S_IFDIR		_IFDIR
sl@0
    88
#define	S_IFCHR		_IFCHR
sl@0
    89
#define	S_IFBLK		_IFBLK
sl@0
    90
#define	S_IFREG		_IFREG
sl@0
    91
#define	S_IFLNK		_IFLNK
sl@0
    92
#define	S_IFSOCK	_IFSOCK
sl@0
    93
#define	S_IFIFO		_IFIFO
sl@0
    94
#endif	/* !_POSIX_SOURCE */
sl@0
    95
sl@0
    96
#define	S_IRWXU 	0000700	/* rwx, owner */
sl@0
    97
#define		S_IRUSR	0000400	/* read permission, owner */
sl@0
    98
#define		S_IWUSR	0000200	/* write permission, owner */
sl@0
    99
#define		S_IXUSR	0000100	/* execute/search permission, owner */
sl@0
   100
#define	S_IRWXG		0000070	/* rwx, group */
sl@0
   101
#define		S_IRGRP	0000040	/* read permission, group */
sl@0
   102
#define		S_IWGRP	0000020	/* write permission, grougroup */
sl@0
   103
#define		S_IXGRP	0000010	/* execute/search permission, group */
sl@0
   104
#define	S_IRWXO		0000007	/* rwx, other */
sl@0
   105
#define		S_IROTH	0000004	/* read permission, other */
sl@0
   106
#define		S_IWOTH	0000002	/* write permission, other */
sl@0
   107
#define		S_IXOTH	0000001	/* execute/search permission, other */
sl@0
   108
sl@0
   109
#define	S_ISBLK(m)	(((m)&_IFMT) == _IFBLK)
sl@0
   110
#define	S_ISCHR(m)	(((m)&_IFMT) == _IFCHR)
sl@0
   111
#define	S_ISDIR(m)	(((m)&_IFMT) == _IFDIR)
sl@0
   112
#define	S_ISFIFO(m)	(((m)&_IFMT) == _IFIFO)
sl@0
   113
#define	S_ISREG(m)	(((m)&_IFMT) == _IFREG)
sl@0
   114
#define	S_ISLNK(m)	(((m)&_IFMT) == _IFLNK)
sl@0
   115
#define	S_ISSOCK(m)	(((m)&_IFMT) == _IFSOCK)
sl@0
   116
sl@0
   117
IMPORT_C int	chmod	( const char *_path, mode_t _mode );
sl@0
   118
IMPORT_C int	wchmod	( const wchar_t *_path, mode_t _mode );
sl@0
   119
IMPORT_C int	fstat	( int _fd, struct stat *_sbuf );
sl@0
   120
IMPORT_C int	mkdir	( const char *_path, mode_t _mode );
sl@0
   121
IMPORT_C int	wmkdir	( const wchar_t *_path, mode_t _mode );
sl@0
   122
IMPORT_C int	stat	( const char *_path, struct stat *_sbuf );
sl@0
   123
IMPORT_C int	wstat	( const wchar_t *_path, struct stat *_sbuf );
sl@0
   124
IMPORT_C char*	realpath (const char *_path, char *resolved);
sl@0
   125
IMPORT_C wchar_t*	wrealpath (const wchar_t * _path, wchar_t * resolved);
sl@0
   126
sl@0
   127
int	mkfifo	( char *_path, mode_t _mode );
sl@0
   128
mode_t	umask	( mode_t _mask );
sl@0
   129
sl@0
   130
#ifdef __cplusplus
sl@0
   131
}
sl@0
   132
#endif
sl@0
   133
#endif /* _SYS_STAT_H */