akaros/tools/syscall_server/newlib_trans.h
<<
>>
Prefs
   1#ifndef NEWLIB_TRANS_H
   2#define NEWLIB_TRANS_H
   3
   4#include <stdint.h>
   5
   6// For translating the stat structure
   7typedef struct newlib_stat {
   8        int16_t st_dev;
   9        uint16_t st_ino;
  10        uint32_t st_mode;
  11        uint16_t st_nlink;
  12        uint16_t st_uid;
  13        uint16_t st_gid;
  14        int16_t st_rdev;
  15        int32_t st_size;
  16        int32_t st_atim;
  17        int32_t st_spare1;
  18        int32_t st_mtim;
  19        int32_t st_spare2;
  20        int32_t st_ctim;
  21        int32_t st_spare3;
  22        int32_t st_blksize;
  23        int32_t st_blocks;
  24        int32_t st_spare4[2];
  25} newlib_stat_t;
  26
  27// For translating the open flags
  28#define NEWLIB_O_RDONLY    0x0000 
  29#define NEWLIB_O_WRONLY    0x0001
  30#define NEWLIB_O_RDWR      0x0002
  31#define NEWLIB_O_APPEND    0x0008
  32#define NEWLIB_O_CREAT     0x0200
  33#define NEWLIB_O_TRUNC     0x0400
  34#define NEWLIB_O_EXCL      0x0800
  35
  36// For translating the open modes
  37#define NEWLIB_S_IRWXU     \
  38        (NEWLIB_S_IRUSR | NEWLIB_S_IWUSR | NEWLIBS_IXUSR)
  39#define     NEWLIB_S_IRUSR 0000400 /* read permission, owner */
  40#define     NEWLIB_S_IWUSR 0000200 /* write permission, owner */
  41#define     NEWLIB_S_IXUSR 0000100/* execute/search permission, owner */
  42#define NEWLIB_S_IRWXG     \
  43        (NEWLIB_S_IRGRP | NEWLIB_S_IWGRP | NEWLIB_S_IXGRP)
  44#define     NEWLIB_S_IRGRP 0000040 /* read permission, group */
  45#define     NEWLIB_S_IWGRP 0000020 /* write permission, grougroup */
  46#define     NEWLIB_S_IXGRP 0000010/* execute/search permission, group */
  47#define NEWLIB_S_IRWXO     \
  48        (NEWLIB_S_IROTH | NEWLIB_S_IWOTH | NEWLIB_S_IXOTH)
  49#define     NEWLIB_S_IROTH 0000004 /* read permission, other */
  50#define     NEWLIB_S_IWOTH 0000002 /* write permission, other */
  51#define     NEWLIB_S_IXOTH 0000001/* execute/search permission, other */
  52
  53// For translating lseek's whence
  54# define    NEWLIB_SEEK_SET    0
  55# define    NEWLIB_SEEK_CUR    1
  56# define    NEWLIB_SEEK_END    2
  57
  58#endif //NEWLIB_TRANS_H
  59