Changeset 2213


Ignore:
Timestamp:
Jul 6, 2005, 5:49:58 AM (20 years ago)
Author:
bird
Message:

o Added getsid and getpgid, correcting the getpgrp implementation.

Location:
trunk/src/emx
Files:
2 added
3 edited

Legend:

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

    • Property cvs2svn:cvs-rev changed from 1.26 to 1.27
    r2212 r2213  
    854854
    855855/**
     856 * Gets the session id of the current process.
     857 * @returns Session id.
     858 * @returns Negated errno on failure.
     859 * @param   pid     Process to get the process group for.
     860 *                  Use 0 for the current process.
     861 */
     862pid_t __libc_Back_processGetSid(pid_t pid);
     863
     864/**
     865 * Gets the process group of the specfied process.
     866 * @returns Process group.
     867 * @returns Negated errno on failure.
     868 * @param   pid     Process to get the process group for.
     869 *                  Use 0 for the current process.
     870 */
     871pid_t __libc_Back_processGetPGrp(pid_t pid);
     872
     873/**
    856874 * Gets the most favourable priority of a process, group of processes
    857875 * or all processed owned by a user.
  • trunk/src/emx/src/lib/misc/getpgrp.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r2212 r2213  
    1 /* getpgrp.c (emx+gcc) -- Copyright (c) 1994-1995 by Eberhard Mattes */
     1/* $Id: $ */
     2/** @file
     3 *
     4 * LIBC - getpgrp().
     5 *
     6 * Copyright (c) 2005 knut st. osmundsen <bird@anduin.net>
     7 *
     8 *
     9 * This file is part of InnoTek LIBC.
     10 *
     11 * InnoTek LIBC is free software; you can redistribute it and/or modify
     12 * it under the terms of the GNU General Public License as published by
     13 * the Free Software Foundation; either version 2 of the License, or
     14 * (at your option) any later version.
     15 *
     16 * InnoTek LIBC is distributed in the hope that it will be useful,
     17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     19 * GNU General Public License for more details.
     20 *
     21 * You should have received a copy of the GNU General Public License
     22 * along with InnoTek LIBC; if not, write to the Free Software
     23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     24 *
     25 */
    226
     27
     28/*******************************************************************************
     29*   Header Files                                                               *
     30*******************************************************************************/
    331#include "libc-alias.h"
    432#include <unistd.h>
    5 #include <process.h>
    6 #include <sys/types.h>
     33#include <errno.h>
     34#include <InnoTekLIBC/backend.h>
     35#define __LIBC_LOG_GROUP __LIBC_LOG_GRP_PROCESS
     36#include <InnoTekLIBC/logstrict.h>
    737
    8 pid_t _STD(getpgrp) (void)
     38
     39/**
     40 * Gets the process group id of the current process.
     41 *
     42 * @returns the process group id.
     43 * @remark  Equivalent to getpgid(0).
     44 */
     45pid_t _STD(getpgrp)(void)
    946{
    10   return getpid ();
     47    LIBCLOG_ENTER("\n");
     48    pid_t pgrp = __libc_Back_processGetPGrp(0);
     49    LIBCLOG_RETURN_INT(pgrp);
    1150}
     51
  • trunk/src/emx/src/lib/sys/b_processCredentials.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r2212 r2213  
    3030*   Header Files                                                               *
    3131*******************************************************************************/
     32#include "libc-alias.h"
     33#include "syscalls.h"
    3234#include <errno.h>
    3335#include <InnoTekLIBC/sharedpm.h>
     
    152154}
    153155
     156
     157/**
     158 * Gets the session id of the current process.
     159 * @returns Session id.
     160 * @returns Negated errno on failure.
     161 * @param   pid     Process to get the process group for.
     162 *                  Use 0 for the current process.
     163 */
     164pid_t __libc_Back_processGetSid(pid_t pid)
     165{
     166    LIBCLOG_ENTER("\n");
     167    pid_t sid;
     168    if (pid == 0 || pid == _sys_pid)
     169        sid = __libc_spmGetId(__LIBC_SPMID_SID);
     170    else
     171        sid = -EACCES;
     172    LIBCLOG_RETURN_INT(sid);
     173}
     174
     175
     176/**
     177 * Gets the process group of the specfied process.
     178 * @returns Process group.
     179 * @returns Negated errno on failure.
     180 * @param   pid     Process to get the process group for.
     181 *                  Use 0 for the current process.
     182 */
     183pid_t __libc_Back_processGetPGrp(pid_t pid)
     184{
     185    LIBCLOG_ENTER("pid=%d\n", pid);
     186    pid_t pgrp;
     187    if (pid == 0 || pid == _sys_pid)
     188        pgrp = __libc_spmGetId(__LIBC_SPMID_PGRP);
     189    else
     190        pgrp = -EACCES;
     191    LIBCLOG_RETURN_INT(pgrp);
     192}
     193
Note: See TracChangeset for help on using the changeset viewer.