Changeset 2289 for trunk/src/emx/include


Ignore:
Timestamp:
Aug 21, 2005, 12:08:50 AM (20 years ago)
Author:
bird
Message:

o Protect the fork operations by the means of must complete so

signals won't interrupt us till we're finished. This might leave
unkillable processes around if fork goes highwire.

o Better exception logging during fork.
o Use MMX memcpy in fork (if supported).
o The C function libc_Back_processFork() replaces the pure assembly fork().

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

Legend:

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

    • Property cvs2svn:cvs-rev changed from 1.28 to 1.29
    r2288 r2289  
    767767
    768768/**
     769 * Fork a child process pretty much identical to the calling process.
     770 * See SuS for full description of what fork() does and doesn't.
     771 *
     772 * @returns 0 in the child process.
     773 * @returns process identifier of the new child in the parent process. (positive, non-zero)
     774 * @returns Negative error code (errno.h) on failure.
     775 */
     776pid_t __libc_Back_processFork(void);
     777
     778/**
    769779 * Waits/polls for on one or more processes to change it's running status.
    770780 *
  • trunk/src/emx/include/InnoTekLIBC/fork.h

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r2288 r2289  
    3434
    3535/** Current fork version. */
    36 #define __LIBC_FORK_VERSION             0x00010000
     36#define __LIBC_FORK_VERSION             0x00020000
     37
     38/** Current fork module version. */
     39#define __LIBC_FORK_MODULE_VERSION      0x00010000
    3740
    3841/** Timeout on waiting semaphore in fork operations */
     
    272275typedef struct __libc_ForkHandle
    273276{
    274     /** Fork version. */
     277    /** Fork version (__LIBC_FORK_VERSION). */
    275278    unsigned                uVersion;
    276279    /** Parent process, i.e. the one which have called fork(). */
     
    422425     * the front. */
    423426    __LIBC_PFORKCOMPLETIONCALLBACK  papfnCompletionCallbacks;
     427    /** Index of the next completion callback for the parent. */
     428    volatile unsigned       iCompletionCallbackParent;
     429    /** Index of the next completion callback for the child. */
     430    volatile unsigned       iCompletionCallbackChild;
    424431
    425432    /** Pointer to the start of the fork buffer. */
     
    538545typedef struct __libc_ForkModule
    539546{
    540     /** Fork version. */
     547    /** Fork module version (__LIBC_FORK_MODULE_VERSION). */
    541548    unsigned                    uVersion;
    542549    /** Fork callback function.
  • trunk/src/emx/include/emx/asm386.h

    • Property cvs2svn:cvs-rev changed from 1.10 to 1.11
    r2288 r2289  
    4040
    4141#define ALIGN   .align  4, 0x90
     42#define ALIGNP2(a) .align  a, 0x90
    4243
    4344#define SET_ERRNO_CONST(x) \
  • trunk/src/emx/include/sys/errno.h

    • Property cvs2svn:cvs-rev changed from 1.10 to 1.11
    r2288 r2289  
    194194#endif /* _POSIX_SOURCE */
    195195
     196#ifdef __USE_EMX
     197#define ENEWVER         90              /* mixing with a new version of a struct */
     198#define EBADVER         91              /* bad version number */
     199#endif
     200
    196201#ifdef _KERNEL
    197202/* pseudo-errors returned inside kernel to modify return to process */
  • trunk/src/emx/include/sys/process.h

    • Property cvs2svn:cvs-rev changed from 1.5 to 1.6
    r2288 r2289  
    77#define _SYS_PROCESS_H
    88
    9 #if defined (__cplusplus)
    10 extern "C" {
     9#include <sys/cdefs.h>
     10#include <sys/_types.h>
     11
     12__BEGIN_DECLS
     13
     14#if !defined(_PID_T_DECLARED) && !defined(_PID_T)
     15typedef __pid_t pid_t;
     16#define _PID_T_DECLARED
     17#define _PID_T
    1118#endif
    1219
     
    5158void exit (int) __attribute__ ((__noreturn__));
    5259void _exit (int) __attribute__ ((__noreturn__));
    53 int fork (void);
    54 int getpid (void);
    55 int getppid (void);
     60pid_t fork (void);
     61pid_t getpid (void);
     62pid_t getppid (void);
    5663int spawnl (int, __const__ char *, __const__ char *, ...);
    5764int spawnle (int, __const__ char *, __const__ char *, ...);
     
    6370int spawnvpe (int, __const__ char *, char * __const__ *, char * __const__ *);
    6471int system (__const__ char *);
    65 int wait (int *);
    66 int waitpid (int, int *, int);
     72pid_t wait (int *);
     73pid_t waitpid (pid_t, int *, int);
    6774
    6875int _execl (__const__ char *, __const__ char *, ...);
     
    7582int _execvpe (__const__ char *, char * __const__ *, char * __const__ *);
    7683int _fork (void);
    77 int _getpid (void);
    78 int _getppid (void);
     84pid_t _getpid (void);
     85pid_t _getppid (void);
    7986int _spawnl (int, __const__ char *, __const__ char *, ...);
    8087int _spawnle (int, __const__ char *, __const__ char *, ...);
     
    8592int _spawnvp (int, __const__ char *, char * __const__ *);
    8693int _spawnvpe (int, __const__ char *, char * __const__ *, char * __const__ *);
    87 int _wait (int *);
    88 int _waitpid (int, int *, int);
     94pid_t _wait (int *);
     95pid_t _waitpid (pid_t, int *, int);
    8996
    90 
    91 #if defined (__cplusplus)
    92 }
    93 #endif
     97__END_DECLS
    9498
    9599#endif /* not _SYS_PROCESS_H */
Note: See TracChangeset for help on using the changeset viewer.