Defines | Functions
core/vpl/os_unix/vpl.cxx File Reference
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <string.h>
#include <vxl_config.h>

Go to the source code of this file.

Defines

#define _XOPEN_SOURCE   1
#define _XOPEN_SOURCE_EXTENDED   1

Functions

char * vpl_getcwd (char *buf, vcl_size_t buf_size)
 Get the pathname of the current working directory.
int vpl_mkdir (const char *dir, unsigned short mode)
 Create a new directory dir with permissions mode.
int vpl_rmdir (const char *dir)
 Remove the directory dir.
int vpl_chdir (const char *dir)
 Change the working directory to dir.
int vpl_unlink (const char *file)
 Remove the file file.
unsigned int vpl_sleep (unsigned int t)
 Sleep for t seconds.
int vpl_usleep (unsigned int t)
 Sleep for t microseconds.
unsigned vpl_getpid ()
 Get the process identifier.
int vpl_putenv (const char *envvar)
 Set environment variable.
int vpl_gethostname (char *name, size_t len)

Define Documentation

#define _XOPEN_SOURCE   1

Definition at line 4 of file vpl.cxx.

#define _XOPEN_SOURCE_EXTENDED   1

Definition at line 6 of file vpl.cxx.


Function Documentation

int vpl_chdir ( const char *  dir)

Change the working directory to dir.

Definition at line 35 of file vpl.cxx.

char* vpl_getcwd ( char *  buf,
vcl_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.

int vpl_gethostname ( char *  name,
size_t  len 
)

Definition at line 92 of file vpl.cxx.

unsigned vpl_getpid ( )

Get the process identifier.

Definition at line 69 of file vpl.cxx.

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.

int vpl_putenv ( const char *  envvar)

Set environment variable.

Parameters:
envvarshould contain the environment variable name and value separated by an equals sign, e.g. "VARNAME=VALUE"

Definition at line 79 of file vpl.cxx.

int vpl_rmdir ( const char *  dir)

Remove the directory dir.

Definition at line 29 of file vpl.cxx.

unsigned int vpl_sleep ( unsigned int  t)

Sleep for t seconds.

Definition at line 47 of file vpl.cxx.

int vpl_unlink ( const char *  file)

Remove the file file.

Definition at line 41 of file vpl.cxx.

int vpl_usleep ( unsigned int  t)

Sleep for t microseconds.

Definition at line 53 of file vpl.cxx.