Changeset 2323 for trunk/src/emx/include


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!

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.34 to 1.35
    r2322 r2323  
    235235 */
    236236int __libc_Back_fsDirCurrentSet(const char *pszPath, int fDrive);
     237
     238/**
     239 * Changes the current directory of the process.
     240 *
     241 * @returns 0 on success.
     242 * @returns Negative error code (errno.h) on failure.
     243 * @param   fh          The handle of an open directory.
     244 * @param   fDrive      Force a change of the current drive too.
     245 */
     246int __libc_Back_fsDirCurrentSetFH(int fh, int fDrive);
    237247
    238248/**
  • 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. */
  • trunk/src/emx/include/fts.h

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r2322 r2323  
    4949        dev_t fts_dev;                  /* starting device # */
    5050        char *fts_path;                 /* path for this descent */
    51 #ifdef __EMX__
    52         char *fts_rdir;                 /* path of root */
    53 #else
    5451        int fts_rfd;                    /* fd for root */
    55 #endif
    5652        int fts_pathlen;                /* sizeof(path) */
    5753        int fts_nitems;                 /* elements in the sort array */
     
    6662#define FTS_SEEDOT      0x020           /* return dot and dot-dot */
    6763#define FTS_XDEV        0x040           /* don't cross devices */
    68 #ifndef __EMX__
    6964#define FTS_WHITEOUT    0x080           /* return whiteout information */
    70 #endif
    7165#define FTS_OPTIONMASK  0x0ff           /* valid user option mask */
    7266
     
    8680        char *fts_path;                 /* root path */
    8781        int fts_errno;                  /* errno for this node */
    88 #ifndef __EMX__
    8982        int fts_symfd;                  /* fd for symlink */
    90 #endif
    9183        u_short fts_pathlen;            /* strlen(fts_path) */
    9284        u_short fts_namelen;            /* strlen(fts_name) */
     
    113105#define FTS_SL          12              /* symbolic link */
    114106#define FTS_SLNONE      13              /* symbolic link without target */
    115 #ifndef __EMX__
    116107#define FTS_W           14              /* whiteout object */
    117 #endif
    118108        u_short fts_info;               /* user flags for FTSENT structure */
    119109
    120110#define FTS_DONTCHDIR    0x01           /* don't chdir .. to the parent */
    121111#define FTS_SYMFOLLOW    0x02           /* followed a symlink to get here */
    122 #ifndef __EMX__
    123112#define FTS_ISW          0x04           /* this is a whiteout object */
    124 #endif
    125113        u_short fts_flags;              /* private flags for FTSENT structure */
    126114
  • trunk/src/emx/include/unistd.h

    • Property cvs2svn:cvs-rev changed from 1.35 to 1.36
    r2322 r2323  
    441441/** @todo char  *ctermid(char *); */            /* XXX ??? */
    442442void     encrypt(char *, int);                  /* bird: SuS say it returns void, and so does our implementation */
    443 /** @todo int    fchdir(int); */
     443int      fchdir(int);
    444444/* tcpip: long   gethostid(void); */
    445445pid_t    getpgid(pid_t _pid);       /* bird: SuS say pid_r return. */
Note: See TracChangeset for help on using the changeset viewer.