#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <dirent.h>
#include <fcntl.h>
#include "debug.h"
#include "config.h"
#include "utils.h"
#include "pcscd.h"
#include "sys_generic.h"
Include dependency graph for utils.c:
Go to the source code of this file.
Defines | |
#define | OPENCT_FILE "/var/run/openct/status" |
Check is OpenCT is running and display a critical message if it is. | |
Functions | |
pid_t | GetDaemonPid (void) |
int | SendHotplugSignal (void) |
int | StatSynchronize (struct pubReaderStatesList *readerState) |
Sends an asynchronous event to any waiting client. | |
int | StatSynchronizeContext (SCARDCONTEXT hContext) |
Sends an asynchronous event to a specific waiting client. | |
int | CheckForOpenCT (void) |
Definition in file utils.c.
#define OPENCT_FILE "/var/run/openct/status" |
Check is OpenCT is running and display a critical message if it is.
The first cause of pcsc-lite failure is that OpenCT is installed and running and has already claimed the USB device. In that case RFAddReader() fails and I get a user support request
Definition at line 200 of file utils.c.
Referenced by CheckForOpenCT().
int StatSynchronize | ( | struct pubReaderStatesList * | readerState | ) |
Sends an asynchronous event to any waiting client.
Just write 1 byte to any fifo in PCSCLITE_EVENTS_DIR and remove the file
This function must be secured since the files are created by the library or any non privileged process. We must not follow symlinks for example
Definition at line 87 of file utils.c.
References Log2, Log3, PCSCLITE_EVENTS_DIR, SYS_CloseFile(), SYS_GetPageSize(), SYS_MMapSynchronize(), SYS_OpenFile(), and SYS_WriteFile().
Referenced by clean_temp_files(), EHStatusHandlerThread(), RFRemoveReader(), SCardConnect(), SCardDisconnect(), and SCardReconnect().
Here is the call graph for this function:
int StatSynchronizeContext | ( | SCARDCONTEXT | hContext | ) |
Sends an asynchronous event to a specific waiting client.
Just write 1 byte to a specific fifo in PCSCLITE_EVENTS_DIR and remove the file
This function must be secured since the files are created by the library or any non privileged process. We must not follow symlinks for example
Definition at line 162 of file utils.c.
References Log2, Log3, PCSCLITE_EVENTS_DIR, SYS_CloseFile(), SYS_GetPID(), SYS_OpenFile(), and SYS_WriteFile().
Referenced by SCardCancel().
Here is the call graph for this function: