utils.c File Reference

utility functions More...

#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)


Detailed Description

utility functions

Definition in file utils.c.


Define Documentation

#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.


Function Documentation

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 SYS_CloseFile(), SYS_GetPageSize(), SYS_MMapSynchronize(), and SYS_OpenFile().

Referenced by 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 SYS_CloseFile(), SYS_GetPID(), and SYS_OpenFile().

Referenced by SCardCancel().

Here is the call graph for this function:


Generated on Mon Aug 17 01:00:15 2009 for pcsc-lite by  doxygen 1.5.9