pcsc-lite 1.9.9
Macros | Functions
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 <pthread.h>
#include "config.h"
#include "debuglog.h"
#include "utils.h"
#include "pcscd.h"
#include "sys_generic.h"

Go to the source code of this file.

Macros

#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 CheckForOpenCT (void)
 
long int time_sub (struct timeval *a, struct timeval *b)
 return the difference (as long int) in µs between 2 struct timeval r = a - b
 
int ThreadCreate (pthread_t *pthThread, int attributes, PCSCLITE_THREAD_FUNCTION(pvFunction), LPVOID pvArg)
 

Detailed Description

utility functions

Definition in file utils.c.

Macro Definition Documentation

◆ OPENCT_FILE

#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 119 of file utils.c.

Function Documentation

◆ CheckForOpenCT()

int CheckForOpenCT ( void  )

Definition at line 120 of file utils.c.

◆ GetDaemonPid()

pid_t GetDaemonPid ( void  )

Definition at line 54 of file utils.c.

◆ SendHotplugSignal()

int SendHotplugSignal ( void  )

Definition at line 90 of file utils.c.

◆ ThreadCreate()

int ThreadCreate ( pthread_t pthThread,
int  attributes,
PCSCLITE_THREAD_FUNCTION(pvFunction ,
LPVOID  pvArg 
)

Definition at line 153 of file utils.c.

◆ time_sub()

long int time_sub ( struct timeval a,
struct timeval b 
)

return the difference (as long int) in µs between 2 struct timeval r = a - b

Definition at line 138 of file utils.c.