Ignore:
Timestamp:
Nov 14, 2004, 6:17:04 AM (21 years ago)
Author:
bird
Message:

Signals, processes and stuff.

File:
1 edited

Legend:

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

    • Property cvs2svn:cvs-rev changed from 1.12 to 1.13
    r1627 r1628  
    497497 * @param   fFlags              Flags of the #defines __LIBC_BSRF_* describing how to
    498498 *                              deliver the signal.
    499  *
    500  * @remark  This Backend Signal API does NOT require the caller to own the signal semaphore.
    501499 */
    502500int __libc_Back_signalRaise(int iSignalNo, siginfo_t *pSigInfo, void *pvXcptOrQueued, unsigned fFlags);
     
    516514 * Send a signal to a process.
    517515 *
     516 * Special case for iSignalNo equal to 0, where no signal is sent but permissions to
     517 * do so is checked.
     518 *
    518519 * @returns 0 on if signal sent.
    519520 * @returns -errno on failure.
     
    521522 * @param   pid         Process Id of the process which the signal is to be sent to.
    522523 * @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.
    524525 */
    525526int __libc_Back_signalSendPid(pid_t pid, int iSignalNo);
    526527
    527528/**
    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 *
    544537 * @param   pgrp        Process group (positive).
    545538 *                      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!)
    547540 * @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.
    548542 */
    549543int __libc_Back_signalSendPGrp(pid_t pgrp, int iSignalNo);
    550 
    551 /**
    552  * Verify the existance of a process group and that the current process
    553  * 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);
    563544
    564545/**
     
    641622/**
    642623 * 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)
    646626 * @param   pSigSet     Temporary signal mask for the thread.
    647627 */
     
    681661int __libc_Back_processWait(idtype_t enmIdType, id_t Id, siginfo_t *pSigInfo, unsigned fOptions, struct rusage *pUsage);
    682662
     663/**
     664 * Gets the real user id of the current process.
     665 * @returns Real user id.
     666 */
     667uid_t __libc_Back_processGetUid(void);
     668
     669/**
     670 * Gets the effective user id of the current process.
     671 * @returns Effective user id.
     672 */
     673uid_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 */
     684int __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 */
     697int __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 */
     704gid_t __libc_Back_processGetGid(void);
     705
     706/**
     707 * Gets the effective group id of the current process.
     708 * @returns Effective group id.
     709 */
     710gid_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 */
     719int __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 */
     732int __libc_Back_processSetGidAll(gid_t rgid, gid_t egid, gid_t svgid);
     733
     734
    683735/** @} */
    684736
Note: See TracChangeset for help on using the changeset viewer.