*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> f90/pxfsetsid (3)              
Title
Content
Arch
Section
 

Contents


PXFSETSID(3F)					       Last changed: 1-6-98

NAME    [Toc]    [Back]

     PXFSETSID - Creates a new session for a calling process

SYNOPSIS    [Toc]    [Back]

     SUBROUTINE	PXFSETSID (isid, ierror)
     INTEGER isid, ierror

IMPLEMENTATION    [Toc]    [Back]

     UNICOS, UNICOS/mk,	and IRIX systems

DESCRIPTION    [Toc]    [Back]

     On	IRIX systems, this routine is in libfortran.so which is	linked by
     default when compiling programs with the MIPSpro 7	Fortran	90 compiler
     or	when compiling programs	with the -craylibs option to the MIPSpro
     7.2 F77 compiler.

     The PXFSETSID routine uses	the setsid(2) system call to create a new
     session for the calling process. The calling process must not be the
     process leader for	PXFSETSID to be	successful.

     After the successful completion of	PXFSETSID, the calling process will
     be	the session leader for the new session and the process group leader
     for the new process group.	The calling process also will have no
     controlling terminal.

     When using	the CF90 compiler or MIPSpro 7 Fortran 90 compiler on
     UNICOS, UNICOS/mk,	or IRIX	systems, all arguments must be of default
     kind unless documented otherwise.	On UNICOS and UNICOS/mk, default
     kind is KIND=8 for	integer, real, complex,	and logical arguments; on
     IRIX, the default kind is KIND=4.

     The following is a	list of	arguments for this routine:

     isid      An output integer variable for the new process group ID of
	       the calling process.

     ierror    An output integer variable that contains	zero if	PXFSETSID
	       was successful or nonzero if PXFSETSID was not successful.

     This routine may return the EPERM error value if the calling process
     is	already	a process group	leader,	or the calling process group ID	of
     a process other than the calling process matches the process ID of	the
     calling process.

EXAMPLES    [Toc]    [Back]

     In	this example, PXFFORK(3F) is called to create a	child process,
     which calls PXFSETSID to create a new session. The	child writes the
     value of ierror to	Fortran	unit 10	and stops. After the fork, the
     parent process waits for the child	to finish execution, and then reads
     from Fortran unit 10. If the value	read in	from unit 10 is	not equal
     to	zero, the child's call to PXFSETSID was	unsucessful.

	  program pxftest
	  integer isid,	iretpid, istat,	ierror,	i

	  CALL PXFFORK(iretpid,ierror)
	  if (ierror .ne. 0) then
	     print *,'FAILED: PXFFORK call with	error =	',ierror
	  else
	     if	(iretpid .eq. 0) then
		CALL PXFSETSID(isid, ierror)
		write (10,*) ierror
		stop
	     else
		CALL PXFWAIT(istat, iretpid, ierror)
		read (10,*) i
		if (i .eq. 0) then
		   print *,'PASSED: PXFSETSID call under normal	conditions'
		else
		   print *,'FAILED: PXFSETSID call with	error =	',i
		endif
	     endif
	  endif

SEE ALSO    [Toc]    [Back]

      
      
     setsid(2)
     PXFFORK(3F)

     Application Programmer's Library Reference	Manual,	publication SR2165,
 for the printed version of this man page.

PXFSETSID(3F)					       Last changed: 1-6-98

NAME    [Toc]    [Back]

     PXFSETSID - Creates a new session for a calling process

SYNOPSIS    [Toc]    [Back]

     SUBROUTINE	PXFSETSID (isid, ierror)
     INTEGER isid, ierror

IMPLEMENTATION    [Toc]    [Back]

     UNICOS, UNICOS/mk,	and IRIX systems

DESCRIPTION    [Toc]    [Back]

     On	IRIX systems, this routine is in libfortran.so which is	linked by
     default when compiling programs with the MIPSpro 7	Fortran	90 compiler
     or	when compiling programs	with the -craylibs option to the MIPSpro
     7.2 F77 compiler.

     The PXFSETSID routine uses	the setsid(2) system call to create a new
     session for the calling process. The calling process must not be the
     process leader for	PXFSETSID to be	successful.

     After the successful completion of	PXFSETSID, the calling process will
     be	the session leader for the new session and the process group leader
     for the new process group.	The calling process also will have no
     controlling terminal.

     When using	the CF90 compiler or MIPSpro 7 Fortran 90 compiler on
     UNICOS, UNICOS/mk,	or IRIX	systems, all arguments must be of default
     kind unless documented otherwise.	On UNICOS and UNICOS/mk, default
     kind is KIND=8 for	integer, real, complex,	and logical arguments; on
     IRIX, the default kind is KIND=4.

     The following is a	list of	arguments for this routine:

     isid      An output integer variable for the new process group ID of
	       the calling process.

     ierror    An output integer variable that contains	zero if	PXFSETSID
	       was successful or nonzero if PXFSETSID was not successful.

     This routine may return the EPERM error value if the calling process
     is	already	a process group	leader,	or the calling process group ID	of
     a process other than the calling process matches the process ID of	the
     calling process.

EXAMPLES    [Toc]    [Back]

     In	this example, PXFFORK(3F) is called to create a	child process,
     which calls PXFSETSID to create a new session. The	child writes the
     value of ierror to	Fortran	unit 10	and stops. After the fork, the
     parent process waits for the child	to finish execution, and then reads
     from Fortran unit 10. If the value	read in	from unit 10 is	not equal
     to	zero, the child's call to PXFSETSID was	unsucessful.

	  program pxftest
	  integer isid,	iretpid, istat,	ierror,	i

	  CALL PXFFORK(iretpid,ierror)
	  if (ierror .ne. 0) then
	     print *,'FAILED: PXFFORK call with	error =	',ierror
	  else
	     if	(iretpid .eq. 0) then
		CALL PXFSETSID(isid, ierror)
		write (10,*) ierror
		stop
	     else
		CALL PXFWAIT(istat, iretpid, ierror)
		read (10,*) i
		if (i .eq. 0) then
		   print *,'PASSED: PXFSETSID call under normal	conditions'
		else
		   print *,'FAILED: PXFSETSID call with	error =	',i
		endif
	     endif
	  endif

SEE ALSO    [Toc]    [Back]

      
      
     setsid(2)
     PXFFORK(3F)

     Application Programmer's Library Reference	Manual,	publication SR2165,
 for the printed version of this man page.

[ Back ]
 Similar pages
Name OS Title
setsid Linux creates a session and sets the process group ID
pthread_atfork Tru64 Declares fork handler routines to be called when the calling thread's process forks a child process
tis_testcancel Tru64 Creates a cancellation point in the calling thread
pxfwait IRIX Obtains information about a calling process' child process
tt_open HP-UX return the process identifier for the calling process
getaudproc HP-UX get the audit process flag for the calling process
aio_suspend Tru64 Suspends the calling process until at least
getgid Tru64 Get the group ID of the calling process
_exit FreeBSD terminate the calling process
getegid Tru64 Get the group ID of the calling process
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service