Changeset 2316 for trunk/src/emx/include


Ignore:
Timestamp:
Aug 29, 2005, 5:35:39 AM (20 years ago)
Author:
bird
Message:

o Reworked the open backend, adding directory support. Some O_*

flags was changed in the process, breaking the old ABI.
This is not fully tested.

o Added more BSD fields to struct stat, breaking the old ABI.

The mtime field and ctime fields will now keep the same values
and the creation time is to be found in birthtime. This means that
ctime will be updated in a few places where it doesn't on unix - but
this is probably better than previously where it wasn't ever updated
when it should.

Location:
trunk/src/emx/include
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/include/InnoTekLIBC/backend.h

    • Property cvs2svn:cvs-rev changed from 1.33 to 1.34
    r2315 r2316  
    398398
    399399/**
    400  * Opens a file.
     400 * Opens or creates a file.
    401401 *
    402402 * @returns Filehandle to the opened file on success.
    403403 * @returns Negative error code (errno.h) on failure.
    404404 * @param   pszFile     Path to the file.
    405  * @param   fFlags      Open flags.
     405 * @param   fLibc       The LIBC open flags (O_*).
     406 * @param   fShare      The share flags (SH_*).
    406407 * @param   cbInitial   Initial filesize.
    407408 * @param   Mode        The specified permission mask.
    408  * @param   fLibc       LIBC filehandle flags.
    409409 * @param   ppFH        Where to store the LIBC filehandle structure which was created
    410410 *                      for the opened file.
    411411 */
    412 int __libc_Back_ioFileOpen(const char *pszFile, int fFlags, off_t cbInitial, mode_t Mode, unsigned fLibc, PLIBCFH *ppFH);
     412int __libc_Back_ioFileOpen(const char *pszFile, unsigned fLibc, int fShare, off_t cbInitial, mode_t Mode, PLIBCFH *ppFH);
    413413
    414414/**
  • trunk/src/emx/include/emx/io.h

    • Property cvs2svn:cvs-rev changed from 1.19 to 1.20
    r2315 r2316  
    3636/*      O_NONBLOCK  0x00000004 */
    3737/*      O_APPEND    0x00000008 */
    38 /* emx  O_TEXT      0x00000010 */
    39 /* emx  O_SIZE      0x00000020 */
    40 /*      free        0x00000040 */
     38/*      reserved    0x00000010 O_SHLOCK */
     39/*      reserved    0x00000020 O_EXLOCK */
     40/*      reserved    0x00000040 O_ASYNC */
    4141/*      O_(F)SYNC   0x00000080 */
    42 /*      O_SYNC      0x00000080 */
    43 /* emx  O_BINARY    0x00000100 */
     42/*      O_NOFOLLOW  0x00000100 */
    4443/*      O_CREAT     0x00000200 */
    4544/*      O_TRUNC     0x00000400 */
    4645/*      O_EXCL      0x00000800 */
    4746/* emx  O_NOINHERIT 0x00001000 */
    48 /*      free        0x00002000 */
    49 /*      free        0x00004000 */
     47/*      free?       0x00002000 */
     48/*      free?       0x00004000 */
    5049/*      O_NOCTTY    0x00008000 */
     50/*      O_DIRECT    0x00010000 */
     51/* emx  O_BINARY    0x00020000 */
     52/* emx  O_TEXT      0x00040000 */
     53/* emx  O_SIZE      0x00080000 */
    5154#define F_EOF       0x00100000
    5255#define F_TERMIO    0x00200000
  • trunk/src/emx/include/sys/fcntl.h

    • Property cvs2svn:cvs-rev changed from 1.8 to 1.9
    r2315 r2316  
    126126/* bird: EMX used 0x2000 for O_SYNC. */
    127127#define O_SYNC          0x0080          /* POSIX synonym for O_FSYNC */
    128 #if 0  /* bird: not implemented - start */
    129128#if __BSD_VISIBLE
    130129#define O_NOFOLLOW      0x0100          /* don't follow symlinks */
    131130#endif
    132 #endif /* bird: not implemented - end */
    133131#define O_CREAT         0x0200          /* create if nonexistent */
    134132#define O_TRUNC         0x0400          /* truncate to zero length */
     
    145143#define O_NOCTTY        0x8000          /* don't assign controlling terminal */
    146144
    147 #if 0  /* bird: not implemented - start */
    148145#if __BSD_VISIBLE
    149146/* Attempt to bypass buffer cache */
    150147#define O_DIRECT        0x00010000
    151148#endif
    152 #endif /* bird: not implemented - end */
    153149
    154150/*
     
    279275#if !defined (O_TEXT)
    280276/* Open flags.
    281    As stated in the FreeBSD part, there is supposidly a limited number of bits
    282    available. We'll try keep it suitable for 16bit just in case (don't care to
    283    check what we use right now) because that'll enable us to share a 32-bit flag
    284    variable per handle to both status (O_*) flags and descriptor (FD_*) flags.
    285 
    286    When we've disabled a few BSD flags and leave out KERNEL stuff the following
    287    bits are available:
    288         0x0010, 0x0020, 0x0040, 0x0100, 0x1000, 0x4000*, 0x2000
    289 */
    290 #define O_TEXT          0x0010
    291 #define O_BINARY        0x0100
    292 #define O_SIZE          0x0020          /* EMX used 0x8000 for O_SIZE. */
     277 *      There is some limits to the available bits, generally FreeBSD limits
     278 *      it's range to the first 16-bits. See emx\io.h for the complete
     279 *      assignments.
     280 */
     281#define O_BINARY    0x00020000
     282#define O_TEXT      0x00040000
     283#define O_SIZE      0x00080000
    293284#if !defined (_POSIX_SOURCE) || defined(__USE_EMX)
    294 #define O_NOINHERIT     0x1000          /* EMX used 0x1000 for O_NOINHERIT. */
     285#define O_NOINHERIT 0x00001000
    295286#endif
    296287#endif
  • trunk/src/emx/include/sys/stat.h

    • Property cvs2svn:cvs-rev changed from 1.11 to 1.12
    r2315 r2316  
    137137struct stat {
    138138        __dev_t   st_dev;               /* inode's device */
     139#if 1 /* bird: emx: */
     140        __uint32_t st_attr;             /* emx: OS/2 & DOS attributes */
     141#endif
    139142        ino_t     st_ino;               /* inode's number */
    140143        mode_t    st_mode;              /* inode protection mode */
     
    143146        gid_t     st_gid;               /* group ID of the file's group */
    144147        __dev_t   st_rdev;              /* device type */
    145 #if 1 /* bird: emx */
    146         time_t    st_atime;
    147         time_t    st_mtime;
    148         time_t    st_ctime;
    149 #else /* bird: emx */
     148#if 1 /* bird: emx - better alignment of 64-bit types */
     149        __int32_t st_lspare;
     150#endif /* bird */
    150151#if __BSD_VISIBLE
    151152        struct  timespec st_atimespec;  /* time of last access */
     
    160161        long      st_ctimensec;         /* nsec of last file status change */
    161162#endif
    162 #endif /* bird: emx */
    163163        off_t     st_size;              /* file size, in bytes */
    164164        __int64_t st_blocks;            /* blocks allocated for file */
    165165        __uint32_t st_blksize;          /* optimal blocksize for I/O */
    166 #if 1 /* bird: emx: */
    167         long      st_attr;              /* emx: OS/2 & DOS attributes */
    168 #else /* bird: emx */
    169 
    170166        fflags_t  st_flags;             /* user defined flags for file */
    171167        __uint32_t st_gen;              /* file generation number */
     168#if 0 /* bird: !emx - it's higher up for packing reasons */
    172169        __int32_t st_lspare;
     170#endif /* bird */
    173171#if __BSD_VISIBLE
    174172        struct timespec st_birthtimespec; /* time of file creation */
     
    189187        unsigned int :(8 / 2) * (16 - (int)sizeof(struct __timespec));
    190188#endif
    191 #endif /* bird: emx - end */
    192189};
    193190
     
    220217#endif /* bird: emx */
    221218
    222 #if 0  /* bird: emx */
    223219#if __BSD_VISIBLE
    224220#define st_atime st_atimespec.tv_sec
     
    227223#define st_birthtime st_birthtimespec.tv_sec
    228224#endif
    229 #endif /* bird: emx */
    230225
    231226#define S_ISUID 0004000                 /* set user id on execution */
Note: See TracChangeset for help on using the changeset viewer.