Access to certain POSIX functions.
More...
#include <cstddef>
#include "vpl/vpl_export.h"
Go to the source code of this file.
|
| VPL_EXPORT char * | vpl_getcwd (char *buf, std::size_t buf_size) |
| | Get the pathname of the current working directory. More...
|
| |
| VPL_EXPORT int | vpl_mkdir (const char *dir, unsigned short mode) |
| | Create a new directory dir with permissions mode. More...
|
| |
| VPL_EXPORT int | vpl_rmdir (const char *dir) |
| | Remove the directory dir. More...
|
| |
| VPL_EXPORT int | vpl_chdir (const char *dir) |
| | Change the working directory to dir. More...
|
| |
| VPL_EXPORT int | vpl_unlink (const char *file) |
| | Remove the file file. More...
|
| |
| VPL_EXPORT unsigned int | vpl_sleep (unsigned int t) |
| | Sleep for t seconds. More...
|
| |
| VPL_EXPORT int | vpl_usleep (unsigned int t) |
| | Sleep for t microseconds. More...
|
| |
| VPL_EXPORT int | vpl_putenv (const char *envvar) |
| | Set environment variable. More...
|
| |
| VPL_EXPORT unsigned | vpl_getpid () |
| | Get the process identifier. More...
|
| |
| VPL_EXPORT int | vpl_gethostname (char *name, std::size_t len) |
| | Get the current machine's hostname. More...
|
| |
Access to certain POSIX functions.
Definition in file vpl.h.
◆ vpl_chdir()
| VPL_EXPORT int vpl_chdir |
( |
const char * |
dir | ) |
|
Change the working directory to dir.
Definition at line 35 of file vpl.cxx.
◆ vpl_getcwd()
| VPL_EXPORT char* vpl_getcwd |
( |
char * |
buf, |
|
|
std::size_t |
buf_size |
|
) |
| |
Get the pathname of the current working directory.
If buf is not NULL, then size must be at least 1 greater than the length of the pathname to be returned and the pathname will be stored in buf. If buf is NULL then the pathname will be returned and the returned pointer may be passed to free() by the caller.
See also: getcwd(3) manpage.
Definition at line 17 of file vpl.cxx.
◆ vpl_gethostname()
| VPL_EXPORT int vpl_gethostname |
( |
char * |
name, |
|
|
std::size_t |
len |
|
) |
| |
Get the current machine's hostname.
Definition at line 66 of file vpl.cxx.
◆ vpl_getpid()
| VPL_EXPORT unsigned vpl_getpid |
( |
| ) |
|
Get the process identifier.
Definition at line 69 of file vpl.cxx.
◆ vpl_mkdir()
| VPL_EXPORT int vpl_mkdir |
( |
const char * |
dir, |
|
|
unsigned short |
mode |
|
) |
| |
Create a new directory dir with permissions mode.
Definition at line 23 of file vpl.cxx.
◆ vpl_putenv()
| VPL_EXPORT int vpl_putenv |
( |
const char * |
envvar | ) |
|
Set environment variable.
- Parameters
-
| envvar | should contain the environment variable name and value separated by an equals sign, e.g. "VARNAME=VALUE" |
Definition at line 79 of file vpl.cxx.
◆ vpl_rmdir()
| VPL_EXPORT int vpl_rmdir |
( |
const char * |
dir | ) |
|
Remove the directory dir.
Definition at line 29 of file vpl.cxx.
◆ vpl_sleep()
| VPL_EXPORT unsigned int vpl_sleep |
( |
unsigned int |
t | ) |
|
Sleep for t seconds.
Definition at line 47 of file vpl.cxx.
◆ vpl_unlink()
| VPL_EXPORT int vpl_unlink |
( |
const char * |
file | ) |
|
Remove the file file.
Definition at line 41 of file vpl.cxx.
◆ vpl_usleep()
| VPL_EXPORT int vpl_usleep |
( |
unsigned int |
t | ) |
|
Sleep for t microseconds.
Definition at line 53 of file vpl.cxx.