Ignore:
Timestamp:
Sep 25, 2005, 1:01:36 PM (20 years ago)
Author:
bird
Message:

o Implemented fchdir().
o Implemented inheritance of open directory handles. Unfortunately,

I ran out of size bits for the bundle type, so the SPM bit is no
longer compatible with earlier versions. The consequences
of this are related to inheritance and signaling - so recompile!

File:
1 edited

Legend:

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

    • Property cvs2svn:cvs-rev changed from 1.24 to 1.25
    r2322 r2323  
    3737
    3838/** The name of the shared semaphore protecting the memory. */
    39 #define SPM_MUTEX_NAME          "\\SEM32\\INNOTEKLIBC-V1.1"
     39#define SPM_MUTEX_NAME          "\\SEM32\\INNOTEKLIBC-V1.3"
    4040
    4141/** The name of the shared memory. */
    42 #define SPM_MEMORY_NAME         "\\SHAREMEM\\INNOTEKLIBC-V1.1"
     42#define SPM_MEMORY_NAME         "\\SHAREMEM\\INNOTEKLIBC-V1.3"
    4343
    4444/** The timeout for accessing the shared mem semaphore. */
     
    6060 * The SPM version.
    6161 */
    62 #define SPM_VERSION             0x00010002
     62#define SPM_VERSION             0x00010003
    6363
    6464
     
    163163#define __LIBC_SPM_INH_FHB_TYPE_END         (0)
    164164/** Standard bundle. */
    165 #define __LIBC_SPM_INH_FHB_TYPE_STANDARD    (0x10 | (sizeof(unsigned) + sizeof(ino_t) + sizeof(dev_t)))
    166 /** The old standard bundle. */
    167 #define __LIBC_SPM_INH_FHB_TYPE_STANDARD_OLD (0x10 | sizeof(unsigned))
     165#define __LIBC_SPM_INH_FHB_TYPE_STANDARD    (0xe0 | (sizeof(unsigned) + sizeof(ino_t) + sizeof(dev_t) + sizeof(unsigned)))
     166/** Directory bundle. */
     167#define __LIBC_SPM_INH_FHB_TYPE_DIRECTORY   (0xc0 | (sizeof(unsigned) + sizeof(ino_t) + sizeof(dev_t) + sizeof(unsigned) + sizeof(unsigned)))
    168168/** Socket bundle, using the BSD 4.4 backend. */
    169 #define __LIBC_SPM_INH_FHB_TYPE_SOCKET_44   (0x20 | (sizeof(unsigned) + sizeof(unsigned short)))
     169#define __LIBC_SPM_INH_FHB_TYPE_SOCKET_44   (0xa0 | (sizeof(unsigned) + sizeof(unsigned short)))
    170170/** Socket bundle, using the BSD 4.3 backend. */
    171 #define __LIBC_SPM_INH_FHB_TYPE_SOCKET_43   (0x30 | (sizeof(unsigned) + sizeof(unsigned short)))
     171#define __LIBC_SPM_INH_FHB_TYPE_SOCKET_43   (0x80 | (sizeof(unsigned) + sizeof(unsigned short)))
     172/*#define __LIBC_SPM_INH_FHB_TYPE_            (0x60 | (sizeof(unsigned) + ))*/
     173/*#define __LIBC_SPM_INH_FHB_TYPE_            (0x40 | (sizeof(unsigned) + ))*/
     174/*#define __LIBC_SPM_INH_FHB_TYPE_            (0x20 | (sizeof(unsigned) + ))*/
     175/*#define __LIBC_SPM_INH_FHB_TYPE_            (0x00 | (sizeof(unsigned) + ))*/
    172176/** Get the per file handle size from the bundle type. */
    173 #define __LIBC_SPM_INH_FHB_SIZE(type)   ((type) & 0x0f)
     177#define __LIBC_SPM_INH_FHB_SIZE(type)   ((type) & 0x1f)
    174178/** @} */
    175179
     
    182186    /** Bundle type. */
    183187    unsigned char   uchType;
    184     /** Cound of handles in this bundle. */
     188    /** Count of handles in this bundle. */
    185189    unsigned char   cHandles;
    186190    /** Start handle number. */
     
    204208    struct
    205209    {
    206         /** The flags */
     210        /** The flags. */
    207211        unsigned            fFlags;
    208212        /** The inode number. */
     
    210214        /** The device number. */
    211215        dev_t               Dev;
     216        /** String table offset of the native path. */
     217        unsigned            offNativePath : 24;
     218        unsigned            u8Reserved : 8;
    212219    } aHandles[1];
    213220} __LIBC_SPMINHFHBSTD;
     
    217224
    218225/**
    219  * SPM standard filehandle inherit bundle
    220  * This is used for OS/2 filehandles which only needs flags
    221  * transfered.
     226 * SPM directory filehandle inherit bundle.
    222227 */
    223228#pragma pack(1)
    224 typedef struct __libc_SPMInhFHOld
     229typedef struct __libc_SPMInhFHDir
    225230{
    226231    /** The common bundle header. */
    227232    __LIBC_SPMINHFHBHDR Hdr;
    228233    /** Array of flags of Hdr.cHandles entries. */
    229     unsigned            afFlags[1];
    230 } __LIBC_SPMINHFHBSTDOLD;
     234    struct
     235    {
     236        /** The flags. */
     237        unsigned            fFlags;
     238        /** The inode number. */
     239        ino_t               Inode;
     240        /** The device number. */
     241        dev_t               Dev;
     242        /** String table offset of the native path. */
     243        unsigned            offNativePath : 24;
     244        /** Set if this path is in the unix tree. */
     245        unsigned            fInUnixTree : 1;
     246        unsigned            u7Reserved : 7;
     247        /** The current position. */
     248        unsigned            uCurEntry;
     249    } aHandles[1];
     250} __LIBC_SPMINHFHBDIR;
    231251#pragma pack()
    232 /** Pointer to SPM standard filehandle inherit bundle. */
    233 typedef __LIBC_SPMINHFHBSTDOLD *__LIBC_PSPMINHFHBSTDOLD;
     252/** Pointer to SPM directory filehandle inherit bundle. */
     253typedef __LIBC_SPMINHFHBDIR *__LIBC_PSPMINHFHBDIR;
    234254
    235255/**
     
    303323    /** Pointer to the signal part. If NULL default values are assumed. */
    304324    __LIBC_PSPMINHSIG       pSig;
    305 
     325    /** Pointer to strings (filenames++).
     326     * All the strings are NULL terminated and referenced by offset. */
     327    char                   *pszStrings;
    306328} __LIBC_SPMINHERIT;
    307329/** Pointer to inherit data. */
Note: See TracChangeset for help on using the changeset viewer.