#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) |
| int | SYS_Unlink (const char *pcFile) |
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 140 of file sys_unix.c.
Referenced by CreateContextThread(), main(), SCardEstablishContextTH(), SCardUnload(), SHMCleanupSharedSegment(), SHMClientCloseSession(), SHMClientSetupSession(), SHMProcessCommonChannelRequest(), SHMProcessEventsContext(), 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 310 of file sys_unix.c.
References Log2, SYS_Chdir(), SYS_CloseFile(), and SYS_Fork().
Referenced by main().
| 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 204 of file sys_unix.c.
Referenced by EHInitializeEventStructures(), EHStatusHandlerThread(), and SCardEstablishContextTH().
| int SYS_GetPID | ( | void | ) |
| 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 219 of file sys_unix.c.
Referenced by EHInitializeEventStructures().
| 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.
Referenced by main().
| 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 285 of file sys_unix.c.
Referenced by EHStatusHandlerThread().
| 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 126 of file sys_unix.c.
Referenced by EHInitializeEventStructures(), main(), and SCardEstablishContextTH().
| 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 247 of file sys_unix.c.
References Log2.
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 270 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 154 of file sys_unix.c.
Referenced by EHInitializeEventStructures().
| 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 HPEstablishUSBNotifications(), MSGCheckHandleAssociation(), and 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 EHDestroyEventHandler(), EHStatusHandlerThread(), SCardBeginTransaction(), SCardConnect(), SCardDisconnect(), SCardDisconnectTH(), SCardEndTransaction(), SCardEndTransactionTH(), SCardGetStatusChange(), and SCardReconnect().
1.4.7