Changeset 1628
- Timestamp:
- Nov 14, 2004, 6:17:04 AM (21 years ago)
- 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.12
to1.13
r1627 r1628 497 497 * @param fFlags Flags of the #defines __LIBC_BSRF_* describing how to 498 498 * deliver the signal. 499 *500 * @remark This Backend Signal API does NOT require the caller to own the signal semaphore.501 499 */ 502 500 int __libc_Back_signalRaise(int iSignalNo, siginfo_t *pSigInfo, void *pvXcptOrQueued, unsigned fFlags); … … 516 514 * Send a signal to a process. 517 515 * 516 * Special case for iSignalNo equal to 0, where no signal is sent but permissions to 517 * do so is checked. 518 * 518 519 * @returns 0 on if signal sent. 519 520 * @returns -errno on failure. … … 521 522 * @param pid Process Id of the process which the signal is to be sent to. 522 523 * @param iSignalNo The signal to send. 523 * @remark This Backend Signal API does NOT require the caller to own the signal semaphore.524 * If 0 no signal is sent, but error handling is done as if. 524 525 */ 525 526 int __libc_Back_signalSendPid(pid_t pid, int iSignalNo); 526 527 527 528 /** 528 * Verify the existance of another process and that the current process 529 * is allowed to signal it. 530 * 531 * @return 0 on success. 532 * @return -ESRCH if pid doesn't exist. 533 * @return -EPERM if we aren't allowed to signal the pid. 534 * @param pid Process Id for the process which we wanna signal. 535 * @todo Do EPERM check, no ideas here yet. 536 * @remark This Backend Signal API does NOT require the caller to own the signal semaphore. 537 */ 538 int __libc_Back_signalVerifyPid(pid_t pid); 539 540 /** 541 * Not implemented. 542 * 543 * @returns -ENOSYS. 529 * Sends a signal to a process group. 530 * 531 * Special case for iSignalNo equal to 0, where no signal is sent but permissions to 532 * do so is checked. 533 * 534 * @returns 0 on if signal sent. 535 * @returns -errno on failure. 536 * 544 537 * @param pgrp Process group (positive). 545 538 * 0 means the process group of this process. 546 * 1 means all process in the system. 539 * 1 means all process in the system. (not implemented!) 547 540 * @param iSignalNo Signal to send to all the processes in the group. 541 * If 0 no signal is sent, but error handling is done as if. 548 542 */ 549 543 int __libc_Back_signalSendPGrp(pid_t pgrp, int iSignalNo); 550 551 /**552 * Verify the existance of a process group and that the current process553 * is allowed to signal it.554 *555 * @return 0 on success.556 * @return -ESRCH if pgid doesn't exist.557 * @return -EPERM if we aren't allowed to signal the pgid.558 * @param pgid Process group id which the current process intend to signal.559 * @todo Do EPERM check, no ideas here yet.560 * @remark This Backend Signal API does NOT require the caller to own the signal semaphore.561 */562 int __libc_Back_signalVerifyPGrp(pid_t pgid);563 544 564 545 /** … … 641 622 /** 642 623 * Suspends the current thread till a signal have been handled. 643 * The signal semaphore is owned. 644 * 645 * @returns Negative error code (errno) on failure. (allways fails) 624 * 625 * @returns Negative error code (errno) on failure. (always fails) 646 626 * @param pSigSet Temporary signal mask for the thread. 647 627 */ … … 681 661 int __libc_Back_processWait(idtype_t enmIdType, id_t Id, siginfo_t *pSigInfo, unsigned fOptions, struct rusage *pUsage); 682 662 663 /** 664 * Gets the real user id of the current process. 665 * @returns Real user id. 666 */ 667 uid_t __libc_Back_processGetUid(void); 668 669 /** 670 * Gets the effective user id of the current process. 671 * @returns Effective user id. 672 */ 673 uid_t __libc_Back_processGetEffUid(void); 674 675 /** 676 * Sets the effective user id of the current process. 677 * If the caller is superuser real and saved user id are also set. 678 * 679 * @returns 0 on success. 680 * @returns Negative error code (errno) on failure. 681 * @param uid New effective user id. 682 * For superusers this is also the new real and saved user id. 683 */ 684 int __libc_Back_processSetUid(uid_t uid); 685 686 /** 687 * Sets the real, effective and saved user ids of the current process. 688 * Unprivilegde users can only set them to the real user id, the 689 * effective user id or the saved user id. 690 * 691 * @returns 0 on success. 692 * @returns Negative error code (errno) on failure. 693 * @param ruid New real user id. Ignore if -1. 694 * @param euid New effective user id. Ignore if -1. 695 * @param svuid New Saved user id. Ignore if -1. 696 */ 697 int __libc_Back_processSetUidAll(uid_t ruid, uid_t euid, uid_t svuid); 698 699 700 /** 701 * Gets the real group id of the current process. 702 * @returns Real group id. 703 */ 704 gid_t __libc_Back_processGetGid(void); 705 706 /** 707 * Gets the effective group id of the current process. 708 * @returns Effective group id. 709 */ 710 gid_t __libc_Back_processGetEffGid(void); 711 712 /** 713 * Sets the effective group id of the current process. 714 * If the caller is superuser real and saved group id are also set. 715 * 716 * @returns 0 on success. 717 * @returns Negative error code (errno) on failure. 718 */ 719 int __libc_Back_processSetGid(gid_t gid); 720 721 /** 722 * Sets the real, effective and saved group ids of the current process. 723 * Unprivilegde users can only set them to the real group id, the 724 * effective group id or the saved group id. 725 * 726 * @returns 0 on success. 727 * @returns Negative error code (errno) on failure. 728 * @param rgid New real group id. Ignore if -1. 729 * @param egid New effective group id. Ignore if -1. 730 * @param svgid New Saved group id. Ignore if -1. 731 */ 732 int __libc_Back_processSetGidAll(gid_t rgid, gid_t egid, gid_t svgid); 733 734 683 735 /** @} */ 684 736 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/InnoTekLIBC/logstrict.h
-
Property cvs2svn:cvs-rev
changed from
1.10
to1.11
r1627 r1628 184 184 #define __LIBC_LOG_GRP_MMAN 16 185 185 186 /** Backend Process APIs. */ 187 #define __LIBC_LOG_GRP_BACK_PROCESS 19 186 188 /** Backend Signal APIs and Events. */ 187 189 #define __LIBC_LOG_GRP_BACK_SIGNAL 20 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/InnoTekLIBC/sharedpm.h
-
Property cvs2svn:cvs-rev
changed from
1.15
to1.16
r1627 r1628 35 35 36 36 /** The name of the shared semaphore protecting the memory. */ 37 #define SPM_MUTEX_NAME "\\SEM32\\INNOTEKLIBC .V01"37 #define SPM_MUTEX_NAME "\\SEM32\\INNOTEKLIBC-V1.1" 38 38 39 39 /** The name of the shared memory. */ 40 #define SPM_MEMORY_NAME "\\SHAREMEM\\INNOTEKLIBC .V01"40 #define SPM_MEMORY_NAME "\\SHAREMEM\\INNOTEKLIBC-V1.1" 41 41 42 42 /** The timeout for accessing the shared mem semaphore. */ … … 60 60 #define SPM_VERSION 0x00010001 61 61 62 /**63 * Process state.64 */65 typedef enum __LIBC_SPMPROCSTAT66 {67 /** The process is free. */68 __LIBC_PROCSTATE_FREE = 0,69 /** The process is waiting for a chile to be created and snatch all the70 * inherited goodies from it.71 * If not caught before DosExecPgm/DosStartSession returns72 * it will be freed by the disapointed parent.73 */74 __LIBC_PROCSTATE_EMBRYO = 1,75 /** The process is running. */76 __LIBC_PROCSTATE_ALIVE = 2,77 /** The process is dead but other guys are still using it's data. */78 __LIBC_PROCSTATE_ZOMBIE = 3,79 /** The maximum state number (exclusive). */80 __LIBC_PROCSTATE_MAX = 10,81 /** Hack to ensure that this will be a 32-bit int. */82 __LIBC_PROCSTATE_MAKE_INT32 = 0x7fffffff83 } __LIBC_SPMPROCSTAT;84 62 85 63 /** … … 109 87 110 88 89 /** Pointer to child termination data. */ 90 typedef struct __LIBC_SPMCHILDNOTIFY *__LIBC_PSPMCHILDNOTIFY; 91 92 /** 93 * Child termination notification data. 94 */ 95 typedef struct __LIBC_SPMCHILDNOTIFY 96 { 97 /** Pointer to the next node in the list. */ 98 __LIBC_PSPMCHILDNOTIFY volatile pNext; 99 /** Structure size. */ 100 unsigned cb; 101 /** Process ID. */ 102 pid_t pid; 103 /** Exit code. */ 104 int iExitCode; 105 /** Reason code. */ 106 __LIBC_EXIT_REASON enmDeathReason; 107 } __LIBC_SPMCHILDNOTIFY; 108 109 110 /** 111 * Process state. 112 */ 113 typedef enum __LIBC_SPMPROCSTAT 114 { 115 /** The process is free. */ 116 __LIBC_PROCSTATE_FREE = 0, 117 /** The process is waiting for a chile to be created and snatch all the 118 * inherited goodies from it. 119 * If not caught before DosExecPgm/DosStartSession returns 120 * it will be freed by the disappointed parent. 121 */ 122 __LIBC_PROCSTATE_EMBRYO = 1, 123 /** The process is running. */ 124 __LIBC_PROCSTATE_ALIVE = 2, 125 /** The process is dead but other guys are still using it's data. */ 126 __LIBC_PROCSTATE_ZOMBIE = 3, 127 /** Reserved process state. */ 128 __LIBC_PROCSTATE_RESERVED = 4, 129 /** The maximum state number (exclusive). */ 130 __LIBC_PROCSTATE_MAX = 5, 131 /** Hack to ensure that this will be a 32-bit int. */ 132 __LIBC_PROCSTATE_MAKE_INT32 = 0x7fffffff 133 } __LIBC_SPMPROCSTAT; 134 135 136 /** Pointer to (queued) signal. */ 137 typedef struct __libc_SPMSignal *__LIBC_PSPMSIGNAL; 138 111 139 /** 112 140 * Signal (queued). … … 117 145 unsigned cb; 118 146 /** Pointer to the next signal. */ 119 struct __libc_SPMSignal *pNext;147 __LIBC_PSPMSIGNAL volatile pNext; 120 148 /** Sender process. 121 149 * This is used to decrement the cSigsSent count of the sender. */ 122 150 pid_t pidSender; 123 124 151 /** Signal info. */ 125 152 siginfo_t Info; 126 153 } __LIBC_SPMSIGNAL; 127 /** Pointer to (queued) signal. */128 typedef __LIBC_SPMSIGNAL *__LIBC_PSPMSIGNAL;129 154 130 155 … … 154 179 unsigned char cHandles; 155 180 /** Start handle number. */ 156 unsigned short fhStart;181 unsigned short StartFH; 157 182 } __LIBC_SPMINHFHBHDR; 158 183 #pragma pack() … … 171 196 __LIBC_SPMINHFHBHDR Hdr; 172 197 /** Array of flags of Hdr.cHandles entries. */ 173 unsigned afFlags[1];198 unsigned afFlags[1]; 174 199 } __LIBC_SPMINHFHBSTD; 175 200 #pragma pack() … … 216 241 typedef __LIBC_SPMINHFS *__LIBC_PSPMINHFS; 217 242 243 /** 244 * SPM signal inherit data. 245 */ 246 typedef struct __libc_SPMInhSig 247 { 248 /** The size of this structure. */ 249 unsigned cb; 250 /** Mask of signals which should be ignored. */ 251 sigset_t SigSetIGN; 252 } __LIBC_SPMINHSIG; 253 /** Pointer to Signal inherit data. */ 254 typedef __LIBC_SPMINHSIG *__LIBC_PSPMINHSIG; 255 218 256 219 257 … … 232 270 /** Pointer to the file system part. If NULL default values are assumed. */ 233 271 __LIBC_PSPMINHFS pFS; 234 235 /** @todo Add signals and the other properties which are inherited. */ 272 /** Pointer to the signal part. If NULL default values are assumed. */ 273 __LIBC_PSPMINHSIG pSig; 274 236 275 } __LIBC_SPMINHERIT; 237 276 /** Pointer to inherit data. */ … … 239 278 240 279 280 /** Pointer to per process data structure. */ 281 typedef struct __libc_SPMProcess *__LIBC_PSPMPROCESS; 282 241 283 /** 242 284 * Per Process Data. … … 244 286 typedef struct __libc_SPMProcess 245 287 { 246 /** Pointer to the next process in the list.288 /** 0 - Pointer to the next process in the list. 247 289 * Every process is in one or another list depending on their state. */ 248 struct __libc_SPMProcess *pNext; 249 /** Pointer to the previous process in the list. */ 250 struct __libc_SPMProcess *pPrev; 251 252 /** Version of the SPM which created this process. */ 290 volatile __LIBC_PSPMPROCESS pNext; 291 /** 4 - Pointer to the previous process in the list. */ 292 volatile __LIBC_PSPMPROCESS pPrev; 293 294 295 /** Core 296 * @{ */ 297 /** 8 - Version of the SPM which created this process. */ 253 298 unsigned uVersion; 254 /** Number of references to this process.299 /** 12 - Number of references to this process. 255 300 * A process is not actually free till the reference count 256 301 * reaches 0. */ 257 unsigned cReferences; 258 /** Process id. */ 302 volatile unsigned cReferences; 303 /** 16 - State of this process. */ 304 volatile __LIBC_SPMPROCSTAT enmState; 305 /** 20 - Process id. */ 259 306 pid_t pid; 260 /** Process id of parent. */ 307 /** 24 - Process id of parent. 308 * This might not match the OS/2 one since there are no notification 309 * when a parent dies. */ 261 310 pid_t pidParent; 262 /** State of this process. */ 263 __LIBC_SPMPROCSTAT enmState; 264 /** The SPM open count of this process. */ 311 /** @} */ 312 313 314 /** User & Group 315 * @{ */ 316 /** 28 - User id. */ 317 uid_t uid; 318 /** 32 - Effective user id. */ 319 uid_t euid; 320 /** 36 - Saved user id. */ 321 uid_t svuid; 322 /** 40 - Group id. */ 323 gid_t gid; 324 /** 44 - Effecive group id. */ 325 gid_t egid; 326 /** 48 - Saved group id. */ 327 gid_t svgid; 328 /** 52 - Supplementary group ids. */ 329 gid_t agidGroups[16 /*NGROUPS_MAX*/]; 330 /** @} */ 331 332 333 /** Misc 334 * @{ */ 335 /** 116 - Creation timestamp. */ 336 unsigned uTimestamp; 337 /** 120 - The SPM open count of this process. */ 265 338 unsigned cSPMOpens; 266 /** Exit code. */ 267 int iExitCode; 268 /** Reason code. */ 269 __LIBC_EXIT_REASON enmDeathReason; 270 /** Pointer to fork module list head. */ 271 void * volatile pvModuleHead; 272 /** Pointer to fork module list tail pointer. */ 273 void * volatile * volatile ppvModuleTail; 274 /** Pointer to fork handle which a child should use when spawned by fork(). */ 275 void *pvForkHandle; 276 /** Creation timestamp. */ 277 unsigned uTimestamp; 278 /** Incoming signal queue (FIFO). 279 * For signals which aren't queable only one signal can be queued. 280 */ 281 volatile __LIBC_PSPMSIGNAL pSigHead; 282 /** Number of signals send. 283 * After _POSIX_SIGQUEUE_MAX signals only SIGCHLD will be allowed sent. 284 */ 285 volatile unsigned cSigsSent; 286 /** Indicates that the process is a full featured LIBC process. 287 * Untill this flag is set (atomically) it's not a good idea to 339 /** 124 - Indicates that the process is a full featured LIBC process. 340 * Until this flag is set (atomically) it's not a good idea to 288 341 * queue signals on the process since it won't have a signal handler 289 342 * installed, and thus won't get to know about them. 290 343 */ 291 344 volatile unsigned fExeInited; 292 293 /** Reserved pool pointer field with default value 0. */ 294 unsigned aReserved[40 - 17]; 295 296 /** Number of possible pointers to shared memory starting at pvInherit. 345 /** 128 - Reserved for future use. Must be 0. */ 346 unsigned uMiscReserved; 347 /** @} */ 348 349 350 /** Fork 351 * @{ */ 352 /** 132 - Pointer to fork module list head. */ 353 void * volatile pvModuleHead; 354 /** 136 - Pointer to fork module list tail pointer. */ 355 void * volatile * volatile ppvModuleTail; 356 /** 140 - Pointer to fork handle which a child should use when spawned by fork(). */ 357 void *pvForkHandle; 358 /** @} */ 359 360 361 /** Signals & Job Control 362 * @{ */ 363 /** 144 - Incoming signal queue (FIFO). 364 * For signals which aren't queable only one signal can be queued. 365 */ 366 volatile __LIBC_PSPMSIGNAL pSigHead; 367 /** 148 - Number of signals send. 368 * After _POSIX_SIGQUEUE_MAX signals only SIGCHLD will be allowed sent. 369 */ 370 volatile unsigned cSigsSent; 371 /** 152 - Session Id. */ 372 pid_t sid; 373 /** 156 - Process group. */ 374 pid_t pgrp; 375 /** 160 - Reserved for future use. Must be 0. */ 376 unsigned uSigReserved1; 377 /** 164 - Reserved for future use. Must be 0. */ 378 unsigned uSigReserved2; 379 /** @} */ 380 381 382 /** Termination 383 * @{ */ 384 /** 168 - Termination information which will be sent to the parent process. */ 385 __LIBC_PSPMCHILDNOTIFY pTerm; 386 /** 172 - List of child termination notifications. */ 387 __LIBC_PSPMCHILDNOTIFY volatile pChildNotifyHead; 388 /** 176 - Pointer to the pointer where to insert the next child notification. */ 389 __LIBC_PSPMCHILDNOTIFY volatile * volatile ppChildNotifyTail; 390 /** @} */ 391 392 393 /** 180 - Reserved pool pointer field with default value 0. */ 394 unsigned auReserved[56 - 45]; 395 396 397 /** 224 - Number of possible pointers to shared memory starting at pvInherit. 297 398 * This means we can extend the structure with pointers for as long as we 298 399 * want and still have older LIBC versions cleanup the mess. */ 299 400 unsigned cPoolPointers; 300 /** Pointer to data inherited from the parent process. */401 /** 228 - Pointer to data inherited from the parent process. */ 301 402 __LIBC_PSPMINHERIT volatile pInherit; 302 /** Pointer to data inherited from the parent process when it's locked.403 /** 232 - Pointer to data inherited from the parent process when it's locked. 303 404 * When locked pInherit is NULL and this member points to the data instead. 304 405 * This prevents spmAlloc() from reclaiming it while it's in use. */ 305 406 __LIBC_PSPMINHERIT volatile pInheritLocked; 306 } __LIBC_SPMPROCESS, *__LIBC_PSPMPROCESS; 307 407 408 } __LIBC_SPMPROCESS; 409 410 /** The current value for __LIBC_SPMPROCESS::cPoolPointers. */ 411 #define __LIBC_SPMPROCESS_POOLPOINTERS 2 308 412 309 413 /** … … 378 482 typedef struct __libc_SPMHeader 379 483 { 380 /** SPM version. (the one which initialized the memory) */381 unsigned uVersion;382 383 /** Size of the shared memory. */384 size_t cb;385 /** Free memory. */386 size_tcbFree;387 /** Start chunk of shared memory pool. */388 __LIBC_PSPMPOOLCHUNKpPoolHead;389 /** End chunk of shared memory pool. */390 __LIBC_PSPMPOOLCHUNKpPoolTail;391 /** Start free chunk in the shared memory pool. */392 __LIBC_PSPMPOOLCHUNKFREEpPoolFreeHead;393 /** End free chunk in the shared memory pool. */394 __LIBC_PSPMPOOLCHUNKFREEpPoolFreeTail;395 396 /** The size of one process block in this version of the shared memory. */397 size_t cbProcess;398 /** Array index by process state giving the head pointers484 /** 0 - SPM version. (the one which initialized the memory) */ 485 unsigned uVersion; 486 487 /** 4 - Size of the shared memory. */ 488 size_t cb; 489 /** 8 - Free memory. */ 490 volatile size_t cbFree; 491 /** 12 - Start chunk of shared memory pool. */ 492 volatile __LIBC_PSPMPOOLCHUNK pPoolHead; 493 /** 16 - End chunk of shared memory pool. */ 494 volatile __LIBC_PSPMPOOLCHUNK pPoolTail; 495 /** 20 - Start free chunk in the shared memory pool. */ 496 volatile __LIBC_PSPMPOOLCHUNKFREE pPoolFreeHead; 497 /** 24 - End free chunk in the shared memory pool. */ 498 volatile __LIBC_PSPMPOOLCHUNKFREE pPoolFreeTail; 499 500 /** 28 - The size of one process block in this version of the shared memory. */ 501 size_t cbProcess; 502 /** 32 - Array index by process state giving the head pointers 399 503 * to the processes in that state. */ 400 __LIBC_PSPMPROCESS volatile apHeads[__LIBC_PROCSTATE_MAX]; 401 402 /** Pointer to the tcpip globals. */ 403 __LIBC_PSPMTCPIP pTcpip; 404 /** Creator pid. */ 405 pid_t pidCreate; 406 /** Creation timestamp. */ 504 volatile __LIBC_PSPMPROCESS apHeads[__LIBC_PROCSTATE_MAX]; 505 /** 52 -List of free child (termination) notification structures. */ 506 volatile __LIBC_PSPMCHILDNOTIFY pChildNotifyFreeHead; 507 508 /** 56 - Pointer to the tcpip globals. */ 509 __LIBC_PSPMTCPIP pTcpip; 510 /** 60 - Creator pid. */ 511 pid_t pidCreate; 512 /** 64 - Creation timestamp. */ 407 513 __extension__ union 408 514 { 409 515 #ifdef INCL_DOSDATETIME 410 DATETIME dtCreate;516 DATETIME dtCreate; 411 517 #endif 412 char ach[16];518 char ach[16]; 413 519 }; 414 520 415 /** System Load Averages. */416 __LIBC_SPMLOADAVGLoadAvg;417 418 /** List of free signal structures. This will reduce521 /** 80 - System Load Averages. */ 522 volatile __LIBC_SPMLOADAVG LoadAvg; 523 524 /** 96 - List of free signal structures. This will reduce 419 525 * the time spent allocating a signal structure in most cases. 420 526 * During SPM init 8 signal structures will be allocated and queued. */ 421 __LIBC_PSPMSIGNALpSigFreeHead;422 /** Number of free signal structures in the list.527 volatile __LIBC_PSPMSIGNAL pSigFreeHead; 528 /** 100 - Number of free signal structures in the list. 423 529 * This is used to prevent the list from growing infinitly under stress. 424 530 * When cSigFree reaches 32 unused signal structures will be freed instead 425 531 * of put in the list. */ 426 unsignedcSigFree;427 /** Number of active signals.532 volatile unsigned cSigFree; 533 /** 104 - Number of active signals. 428 534 * This is used to keep a reasonable limit of the number of active signal 429 535 * structures so a process cannot exhaust the shared memory pool. 430 536 * The maximum is defined by cSigMaxActive. 431 537 */ 432 unsignedcSigActive;433 /** The maximum number of active signals.538 volatile unsigned cSigActive; 539 /** 108 - The maximum number of active signals. 434 540 * This is initialized by the SPM creator but can be adjusted later. 435 541 */ 436 unsigned cSigMaxActive; 437 438 /* The rest of the block, up to cbProcess, is undefined in this version. 542 unsigned cSigMaxActive; 543 /** 112 - Notification event semaphore. 544 * This semaphore is signaled when an event occurs. 545 */ 546 unsigned long hevNotify; 547 548 /* 116 - The rest of the block, up to cbProcess, is undefined in this version. 439 549 * Future versions of LIBC may use this area assuming it's initalized with zeros. 440 550 */ … … 550 660 551 661 /** 552 * Gets the exit code and reason of death for a specific child process553 * which is believed to have died.662 * Query about notifications from a specific child process. 663 * The notifications are related to death, the cause and such. 554 664 * 555 665 * @returns 0 on success. 556 666 * @returns Negative error code (errno.h) on failure. 557 667 * @param pid Process id. 558 * @param pendDeathReason Where to store the death reason. 559 * @param piExitCode Where to store the exit code. 560 */ 561 int __libc_spmReapChild(pid_t pid, __LIBC_EXIT_REASON *penmDeathReason, int *piExitCode); 668 * @param pNotify Where to store the notification from the child. 669 */ 670 int __libc_spmQueryChildNotification(pid_t pid, __LIBC_PSPMCHILDNOTIFY pNotifyOut); 671 672 /** 673 * Identificators which can be obtained using __libc_spmGetId(). 674 */ 675 typedef enum __LIBC_SPMId 676 { 677 __LIBC_SPMID_PID = 0, 678 __LIBC_SPMID_PPID, 679 __LIBC_SPMID_SID, 680 __LIBC_SPMID_PGRP, 681 __LIBC_SPMID_UID, 682 __LIBC_SPMID_EUID, 683 __LIBC_SPMID_SVUID, 684 __LIBC_SPMID_GID, 685 __LIBC_SPMID_EGID, 686 __LIBC_SPMID_SVGID 687 } __LIBC_SPMID; 688 689 690 /** 691 * Gets the specified Id. 692 * 693 * @returns Requested Id. 694 * @param enmId Identification to get. 695 */ 696 unsigned __libc_spmGetId(__LIBC_SPMID enmId); 697 698 /** 699 * Sets the effective user id of the current process. 700 * If the caller is superuser real and saved user id are also set. 701 * 702 * @returns 0 on success. 703 * @returns Negative error code (errno) on failure. 704 * @param uid New effective user id. 705 * For superusers this is also the new real and saved user id. 706 */ 707 int __libc_spmSetUid(uid_t uid); 708 709 /** 710 * Sets the real, effective and saved user ids of the current process. 711 * Unprivilegde users can only set them to the real user id, the 712 * effective user id or the saved user id. 713 * 714 * @returns 0 on success. 715 * @returns Negative error code (errno) on failure. 716 * @param ruid New real user id. Ignore if -1. 717 * @param euid New effective user id. Ignore if -1. 718 * @param svuid New Saved user id. Ignore if -1. 719 */ 720 int __libc_spmSetUidAll(uid_t ruid, uid_t euid, uid_t svuid); 721 722 /** 723 * Sets the effective group id of the current process. 724 * If the caller is superuser real and saved group id are also set. 725 * 726 * @returns 0 on success. 727 * @returns Negative error code (errno) on failure. 728 */ 729 int __libc_spmSetGid(gid_t gid); 730 731 /** 732 * Sets the real, effective and saved group ids of the current process. 733 * Unprivilegde users can only set them to the real group id, the 734 * effective group id or the saved group id. 735 * 736 * @returns 0 on success. 737 * @returns Negative error code (errno) on failure. 738 * @param rgid New real group id. Ignore if -1. 739 * @param egid New effective group id. Ignore if -1. 740 * @param svgid New Saved group id. Ignore if -1. 741 */ 742 int __libc_spmSetGidAll(gid_t rgid, gid_t egid, gid_t svgid); 562 743 563 744 /** … … 668 849 * @returns 0 on success. 669 850 * @returns Negative error code (errno.h) on failure. 670 * @param pSignal Signal to queue. 851 */ 852 void __libc_spmExeInited(void); 853 854 /** 855 * Queues a signal on another process. 856 * 857 * @returns 0 on success. 858 * @returns Negative error code (errno.h) on failure. 859 * @param pSigInfo Signal to queue. 671 860 * @param pid Pid to queue it on. 672 861 * @param fQueued Set if the signal type is queued. 673 862 */ 674 void __libc_spmExeInited(void); 863 int __libc_spmSigQueue(int iSignalNo, siginfo_t *pSigInfo, pid_t pid, int fQueued); 864 865 /** 866 * Callback which is called when a signal have been queued on a process. 867 * 868 * @returns 0 on success. 869 * @returns Negative error code (errno.h) on failure. 870 * @param iSignalNo The signal which have been queued. 871 * @param pProcess Process which the signal was queued on. 872 * @param pvUser User argument. 873 */ 874 typedef int (*__LIBC_PFNSPMSIGNALED)(int iSignalNo, const __LIBC_SPMPROCESS * pProcess, void *pvUser); 675 875 676 876 /** … … 679 879 * @returns 0 on success. 680 880 * @returns Negative error code (errno.h) on failure. 681 * @param pSignal Signal to queue. 682 * @param pid Pid to queue it on. 881 * @param iSignalNo The signal to send. If 0 only permissions are checked. 882 * @param pSigInfo Signal to queue. If NULL only permissions are checked. 883 * @param pgrp Process group to queue a signal on. 683 884 * @param fQueued Set if the signal type is queued. 684 */ 685 int __libc_spmSigQueue(siginfo_t *pSignal, pid_t pid, int fQueued); 885 * @param pfnCallback Pointer to callback function to post process signaled processes. 886 * The callback must be _very_ careful. No crashing or blocking! 887 * @param pvUser User argument specified to pfnCallback. 888 */ 889 int __libc_spmSigQueuePGrp(int iSignalNo, siginfo_t *pSigInfo, pid_t pgrp, int fQueued, __LIBC_PFNSPMSIGNALED pfnCallback, void *pvUser); 686 890 687 891 /** -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/os2emx.h
-
Property cvs2svn:cvs-rev
changed from
1.20
to1.21
r1627 r1628 13334 13334 typedef struct _LINFOSEG 13335 13335 { 13336 PIDpidCurrent;13337 PIDpidParent;13336 USHORT pidCurrent; 13337 USHORT pidParent; 13338 13338 USHORT prtyCurrent; 13339 TIDtidCurrent;13339 USHORT tidCurrent; 13340 13340 USHORT sgCurrent; 13341 13341 UCHAR rfProcStatus; 13342 13342 UCHAR dummy1; 13343 BOOLfForeground;13343 USHORT fForeground; 13344 13344 UCHAR typeProcess; 13345 13345 UCHAR dummy2; … … 13349 13349 USHORT cbStack; 13350 13350 USHORT cbHeap; 13351 HMODULEhmod;13351 USHORT hmod; 13352 13352 SEL selDS; 13353 13353 } LINFOSEG; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/unistd.h
-
Property cvs2svn:cvs-rev
changed from
1.23
to1.24
r1627 r1628 423 423 #if __POSIX_VISIBLE >= 200112 424 424 /* tcpip: int gethostname(char *, size_t); */ 425 /** @todo int setegid(gid_t); */ 426 /** @todo int seteuid(uid_t); */ 425 int setegid(gid_t); 426 int seteuid(uid_t); 427 427 #endif 428 428 … … 452 452 /** @todo ssize_t pwrite(int, const void *, size_t, off_t); */ 453 453 /** @todo int setpgrp(pid_t _pid, pid_t _pgrp); */ /* obsoleted by setpgid() */ 454 /** @todo int setregid(gid_t, gid_t); */ 455 /** @todo int setreuid(uid_t, uid_t); */ 454 int setregid(gid_t, gid_t); 455 int setreuid(uid_t, uid_t); 456 456 /* void swab(const void * __restrict, void * __restrict, ssize_t); */ 457 457 void sync(void); … … 545 545 /** @todo int setlogin(const char *); */ 546 546 /* crash with DOS: void *setmode(const char *); */ 547 /** @todo int setresgid(gid_t, gid_t, gid_t); */ 548 /** @todo int setresuid(uid_t, uid_t, uid_t); */ 549 /** @todo int setrgid(gid_t); */ 550 /** @todo int setruid(uid_t); */ 547 int setresgid(gid_t, gid_t, gid_t); 548 int setresuid(uid_t, uid_t, uid_t); 549 int setrgid(gid_t); 550 int setruid(uid_t); 551 551 void setusershell(void); 552 552 /** @todo int strtofflags(char **, u_long *, u_long *); */ -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.