#include <sys/stat.h>
#include <sys/mman.h>
Go to the source code of this file.
Functions | |
int | SYS_Initialize (void) |
Make system wide initialization. | |
int | SYS_Mkdir (const char *, int) |
Attempts to create a directory with some permissions. | |
int | SYS_GetPID (void) |
Gets the running process's ID. | |
int | SYS_Sleep (int) |
Makes the current process sleep for some seconds. | |
int | SYS_USleep (int) |
Makes the current process sleep for some microseconds. | |
int | SYS_OpenFile (const char *, int, int) |
Opens/creates a file. | |
int | SYS_CloseFile (int) |
Opens/creates a file. | |
int | SYS_RemoveFile (const char *) |
Removes a file. | |
int | SYS_Chmod (const char *, int) |
int | SYS_Chdir (const char *) |
int | SYS_GetUID (void) |
int | SYS_GetGID (void) |
int | SYS_ChangePermissions (const char *, int) |
int | SYS_SeekFile (int, int) |
int | SYS_ReadFile (int, char *, int) |
int | SYS_WriteFile (int, const char *, int) |
int | SYS_GetPageSize (void) |
Gets the memory page size. | |
void * | SYS_MemoryMap (int, int, int) |
Map the file iFid in memory for reading and writing. | |
void * | SYS_PublicMemoryMap (int, int, int) |
Map the file iFid in memory only for reading. | |
void | SYS_PublicMemoryUnmap (void *, int) |
Unmap a memory segment. | |
int | SYS_MMapSynchronize (void *, int) |
Writes the changes made in a memory map to the disk mapped file. | |
int | SYS_Fork (void) |
int | SYS_Daemon (int, int) |
put the process to run in the background. | |
int | SYS_Stat (const char *pcFile, struct stat *psStatus) |
int | SYS_RandomInt (int, int) |
int | SYS_GetSeed (void) |
void | SYS_Exit (int) |
Definition in file sys_generic.h.
int SYS_CloseFile | ( | int | iHandle | ) |
Opens/creates a file.
[in] | iHandle | File descriptor. |
0 | Success. | |
-1 | An error ocurred. |
Definition at line 143 of file sys_unix.c.
Referenced by CreateContextThread(), SCardEstablishContextTH(), SCardUnload(), SHMCleanupSharedSegment(), SHMClientCloseSession(), SHMClientSetupSession(), SHMProcessCommonChannelRequest(), SHMProcessEventsContext(), StatSynchronize(), StatSynchronizeContext(), and SYS_Daemon().
int SYS_Daemon | ( | int | nochdir, | |
int | noclose | |||
) |
put the process to run in the background.
[in] | nochdir | if zero, change the current directory to "/". |
[in] | noclose | if zero, redirect standard imput/output/error to /dev/nulll. |
0 | success. | |
-1 | an error ocurred. |
Definition at line 318 of file sys_unix.c.
References SYS_CloseFile().
int SYS_GetPageSize | ( | void | ) |
Gets the memory page size.
The page size is used when calling the SYS_MemoryMap()
and SYS_PublicMemoryMap()
functions.
Definition at line 207 of file sys_unix.c.
Referenced by SCardEstablishContextTH(), and StatSynchronize().
int SYS_GetPID | ( | void | ) |
Gets the running process's ID.
Definition at line 71 of file sys_unix.c.
Referenced by StatSynchronizeContext().
int SYS_Initialize | ( | void | ) |
Make system wide initialization.
0 | Success. |
Definition at line 43 of file sys_unix.c.
Referenced by SCardEstablishContextTH().
void* SYS_MemoryMap | ( | int | iSize, | |
int | iFid, | |||
int | iOffset | |||
) |
Map the file iFid
in memory for reading and writing.
[in] | iSize | Size of the memmory mapped. |
[in] | iFid | File which will be mapped in memory. |
[in] | iOffset | Start point of the file to be mapped in memory. |
MAP_FAILED | in case of error |
Definition at line 227 of file sys_unix.c.
int SYS_Mkdir | ( | const char * | path, | |
int | perms | |||
) |
Attempts to create a directory with some permissions.
[in] | path | Path of the directory to be created. |
[in] | perms | Permissions to the new directory. |
0 | Success. | |
-1 | An error occurred. |
Definition at line 61 of file sys_unix.c.
int SYS_MMapSynchronize | ( | void * | begin, | |
int | length | |||
) |
Writes the changes made in a memory map to the disk mapped file.
[in] | begin | Start of the block to be written |
[in] | length | Lenght of the block to be written |
0 | Success. | |
-1 | An error ocurred. |
Definition at line 293 of file sys_unix.c.
Referenced by StatSynchronize().
int SYS_OpenFile | ( | const char * | pcFile, | |
int | flags, | |||
int | mode | |||
) |
Opens/creates a file.
[in] | pcFile | path to the file. |
[in] | flags | Open and read/write choices. |
[in] | mode | Permissions to the file. |
>0 | The file descriptor. | |
-1 | An error ocurred. |
Definition at line 127 of file sys_unix.c.
Referenced by SCardEstablishContextTH(), StatSynchronize(), and StatSynchronizeContext().
void* SYS_PublicMemoryMap | ( | int | iSize, | |
int | iFid, | |||
int | iOffset | |||
) |
Map the file iFid
in memory only for reading.
[in] | iSize | Size of the memmory mapped. |
[in] | iFid | File which will be mapped in memory. |
[in] | iOffset | Start point of the file to be mapped in memory. |
Definition at line 255 of file sys_unix.c.
Referenced by SCardEstablishContextTH().
void SYS_PublicMemoryUnmap | ( | void * | ptr, | |
int | iSize | |||
) |
Unmap a memory segment.
ptr | pointer returned by SYS_PublicMemoryMap() | |
iSize | size of the memory segment |
Definition at line 278 of file sys_unix.c.
Referenced by SCardUnload().
int SYS_RemoveFile | ( | const char * | pcFile | ) |
Removes a file.
[in] | pcFile | path to the file. |
0 | Success. | |
-1 | An error ocurred. |
Definition at line 157 of file sys_unix.c.
Referenced by SHMCleanupSharedSegment(), and SHMInitializeCommonSegment().
int SYS_Sleep | ( | int | iTimeVal | ) |
Makes the current process sleep for some seconds.
[in] | iTimeVal | Number of seconds to sleep. |
Definition at line 81 of file sys_unix.c.
Referenced by SVCServiceRunLoop().
int SYS_USleep | ( | int | iTimeVal | ) |
Makes the current process sleep for some microseconds.
[in] | iTimeVal | Number of microseconds to sleep. |
Definition at line 99 of file sys_unix.c.
Referenced by IFDCloseIFD(), SCardBeginTransaction(), SCardConnect(), SCardDisconnect(), SCardEndTransaction(), and SCardGetStatusChange().