Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
ftok(3C)							      ftok(3C)

NAME
       ftok() -	create interprocess communication identifier

SYNOPSIS

DESCRIPTION
       All  interprocess communication facilities require the user to supply a
       key to be used by the and system	calls to obtain	interprocess  communi-
       cation identifiers (see msgget(2), semget(2), and shmget(2)).

       returns	a  key	based  on path and id that is usable in	subsequent and
       system calls.

       The parameters for the function are as follows:

	      path		  must be the path name	of  an	existing  file
				  that is accessible to	the process.

	      id		  is  a	 character  that uniquely identifies a
				  project.  This means that only the low order
				  8-bits of id are significant.	 Note that re-
				  turns	the same key  for  linked  files  when
				  called  with the same	id and that it returns
				  different keys when  called  with  the  same
				  file name but	different ids.

RETURN VALUE
       returns	if  path  does	not  exist  or	if it is not accessible	to the
       process.

EXAMPLES
       The following call to returns a key associated with the file myfile and
       id

WARNINGS
       If the file whose path is passed	to is removed when keys	still refer to
       the file, future	calls to with the same path and	id will	return an  er-
       ror.   If  the  same file is recreated, is likely to return a different
       key than	it did the original time it was	called.

SEE ALSO
       intro(2), msgget(2), semget(2), shmget(2), thread_safety(5).

								      ftok(3C)

NAME | SYNOPSIS | DESCRIPTION | RETURN VALUE | EXAMPLES | WARNINGS | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=stdipc&sektion=3c&manpath=HP-UX+11.22>

home | help