Functions | |
| status_t | rename_process (int nProcessID, const char *pzName) |
| Rename a process. More... | |
| int | alloc_tld (void) |
| Allocate a TLD slot. More... | |
| int | free_tld (int nHandle) |
| Release a TLD slot. More... | |
| status_t | delete_semaphore (sem_id hSema) |
| Delete a kernel semaphore. More... | |
| status_t | lock_semaphore_ex (sem_id hSema, int nCount, uint32 nFlags, bigtime_t nTimeOut) |
| Aquire a semaphore. More... | |
| status_t | lock_semaphore (sem_id hSema, uint32 nFlags, bigtime_t nTimeOut) |
| Lock a semaphore. More... | |
| status_t | unlock_semaphore_ex (sem_id hSema, int nCount) |
| Release a semaphore. More... | |
| status_t | unlock_semaphore (sem_id hSema) |
| Release a semaphore. More... | |
| int | based_open (int nRootFD, const char *pzPath, int nFlags,...) |
| Open a file relative to a given directory. More... | |
| int | freadlink (int nFile, char *pzBuffer, size_t nBufSize) |
| Read the content of an previously opened symlink. More... | |
| void | set_tld (int nHandle, int nValue) |
| Assign a value to a TLD slot. More... | |
| int | get_tld (int nHandle) |
| Retrieve the value stored in a TLD. More... | |
|
|
Allocate a TLD slot.
|
|
|
Open a file relative to a given directory.
nRootFD.
The "real" current working directory is not affected. This provide a thread-safe way to do do the following:
int nOldDir = open( ".", O_RDONLY );
fchdir( nRootFD );
nFile = open( pzPath, ... );
fchdir( nOldDir );
close( nOldDir );The problem with the above example in a multithreaded environment is that other threads will be affected by the change of current working directory and might get into trouble while we temporarily change it. Using based_open() is also more efficient since only one kernel-call is done (based_open() is just as efficient as open()).
|
|
|
Delete a kernel semaphore.
|
|
|
Read the content of an previously opened symlink.
Normally when passing a symlink path to open() it will automatically open the file/dir that the link points to and not the link itself. To stop open() from traversing the links you can add the O_NOTRAVERSE flag to the open-mode. open() will then return a file-handle representing the link itself rather than the file the link points at.
|
|
|
Release a TLD slot.
|
|
|
Retrieve the value stored in a TLD.
|
|
|
Lock a semaphore.
|
|
|
Aquire a semaphore.
|
|
|
Rename a process.
|
|
|
Assign a value to a TLD slot.
|
|
|
Release a semaphore.
|
|
|
Release a semaphore.
|
1.2.5 written by Dimitri van Heesch,
© 1997-2001