procutil.h File Reference

#include <QString>
#include <sys/types.h>
#include <unistd.h>
#include <signal.h>
#include <errno.h>

Go to the source code of this file.

Functions

qint64 get_pid ()
bool is_process_running (qint64 pid)
bool write_pidfile (QString pidfile, QString *errmsg=0)
qint64 read_pidfile (QString pidfile, QString *errmsg=0)
QHash< qint64, QString > process_list ()
bool process_kill (qint64 pid)

Function Documentation

qint64 get_pid (  ) 

Returns the PID of the current process.

Definition at line 29 of file procutil.cpp.

Referenced by main(), and write_pidfile().

bool is_process_running ( qint64  pid  ) 

Returns true if a process with the given PID is running.

Definition at line 40 of file procutil.cpp.

References win32_process_list().

Referenced by is_vidalia_running().

bool process_kill ( qint64  pid  ) 

Attempt to kill process pid. Return true if the specified process was successfully terminated. Otherwise, return false.

Definition at line 118 of file procutil.cpp.

Referenced by MainWindow::authenticationFailed().

QHash<qint64, QString> process_list (  ) 

Return a list of all currently running PIDs and their associated process names.

Definition at line 108 of file procutil.cpp.

References win32_process_list().

Referenced by MainWindow::authenticationFailed().

qint64 read_pidfile ( QString  pidFileName,
QString *  errmsg 
)

Reads the giiven pidfile and returns the value in it. If the file does not exist, -1 is returned.

Reads the given pidfile and returns the value contained in it. If the file does not exist 0 is returned. Returns -1 if an error occurs.

Definition at line 85 of file procutil.cpp.

Referenced by is_vidalia_running().

bool write_pidfile ( QString  pidFileName,
QString *  errmsg 
)

Writes the given file to disk containing the current process's PID.

Definition at line 62 of file procutil.cpp.

References err(), and get_pid().

Referenced by main().


Generated on Wed Dec 23 21:11:10 2009 for Vidalia by  doxygen 1.6.1