KDE3Support
k3process.cpp
Go to the documentation of this file.
700 #if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__GNU__) && !defined(__DragonFly__)
807 kWarning(175) << "Invalid usePty/communication combination (" << d->usePty << "/" << comm << ")" << endl;
int childError(int fdno)
Called by slotChildError() this function copies data arriving from the child process' stderr to the r...
Definition: k3process.cpp:785
bool runPrivileged() const
Returns whether the started process will drop any setuid/setgid privileges or whether it will keep th...
Definition: k3process.cpp:162
If specified with Stdout, no data is actually read from stdout, only the signal receivedStdout(int fd...
Definition: k3process.h:149
virtual void processHasExited(int state)
Immediately called after a successfully started process in NotifyOnExit mode has exited.
Definition: k3process.cpp:747
const char * input_data
The buffer holding the data that has to be sent to the child.
Definition: k3process.h:827
If specified with Stdout, the process' stderr will be redirected onto the same file handle as its std...
Definition: k3process.h:154
void setUseShell(bool useShell, const char *shell=0)
Specify whether to start the command via a shell or directly.
Definition: k3process.cpp:693
bool signalled() const
Checks whether the process was killed by a signal.
Definition: k3process.cpp:532
void removeKProcess(K3Process *)
Definition: k3processcontroller.cpp:321
bool keepPrivs
If false, the child process' effective uid & gid will be reset to the real values.
Definition: k3process.h:690
void processExited(K3Process *proc)
Emitted after the process has terminated when the process was run in the NotifyOnExit (==default opti...
void suspend()
Suspend processing of data from stdout of the child process.
Definition: k3process.cpp:580
void setWorkingDirectory(const QString &dir)
Changes the current working directory (CWD) of the process to be started.
Definition: k3process.cpp:135
static void deref()
Destroy the instance if one exists and it is not referenced any more.
Definition: k3processcontroller.cpp:73
virtual bool start(RunMode runmode=NotifyOnExit, Communication comm=NoCommunication)
Starts the process.
Definition: k3process.cpp:239
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
void receivedStdout(K3Process *proc, char *buffer, int buflen)
Emitted, when output from the child process has been received on stdout.
void setRunPrivileged(bool keepPrivileges)
Controls whether the started process should drop any setuid/setgid privileges or whether it should ke...
Definition: k3process.cpp:156
void setEnvironment(const QString &name, const QString &value)
Adds the variable name to the process' environment.
Definition: k3process.cpp:129
void slotChildError(int fdno)
This slot gets activated when data from the child's stderr arrives.
Definition: k3process.cpp:666
int open(const QString &pathname, int flags, mode_t mode)
virtual int commSetupDoneP()
Called right after a (successful) fork() on the parent side.
Definition: k3process.cpp:866
bool setPriority(int prio)
Sets the scheduling priority of the process.
Definition: k3process.cpp:168
virtual int commSetupDoneC()
Called right after a (successful) fork(), but before an exec() on the child process' side...
Definition: k3process.cpp:911
void rescheduleCheck()
This function must be called at some point after calling unscheduleCheck().
Definition: k3processcontroller.cpp:233
QList< QByteArray > arguments
The list of the process' command line arguments.
Definition: k3process.h:652
void unscheduleCheck()
Call this function to defer processing of the data that became available on notifierFd().
Definition: k3processcontroller.cpp:225
void addKProcess(K3Process *)
Definition: k3processcontroller.cpp:316
Same as NotifyOnExit, but the process is run in an own session, just like with DontCare.
Definition: k3process.h:183
bool writeStdin(const char *buffer, int buflen)
Transmit data to the child process' stdin.
Definition: k3process.cpp:560
bool wait(int timeout=-1)
Suspend execution of the current thread until the child process dies or the timeout hits...
Definition: k3process.cpp:462
void receivedStderr(K3Process *proc, char *buffer, int buflen)
Emitted, when output from the child process has been received on stderr.
virtual int setupCommunication(Communication comm)
This function is called from start() right before a fork() takes place.
Definition: k3process.cpp:800
void setupEnvironment()
Sets up the environment according to the data passed via setEnvironment()
Definition: k3process.cpp:141
void wroteStdin(K3Process *proc)
Emitted after all the data that has been specified by a prior call to writeStdin() has actually been ...
KGuiItem ok()
void resume()
Resume processing of data from stdout of the child process.
Definition: k3process.cpp:586
void slotSendData(int dummy)
Called when another bulk of data can be sent to the child's stdin.
Definition: k3process.cpp:673
Definition: k3process.h:127
virtual bool kill(int signo=SIGTERM)
Stop the process (by sending it a signal).
Definition: k3process.cpp:429
void setBinaryExecutable(const char *filename)
Specify the actual executable that should be started (first argument to execve) Normally the first ar...
Definition: k3process.cpp:204
int access(const QString &path, int mode)
K3Process & operator<<(const QString &arg)
Sets the executable and the command line argument list for this process.
Definition: k3process.cpp:228
The application is suspended until the started process is finished.
Definition: k3process.h:178
Communication communication
Lists the communication links that are activated for the child process.
Definition: k3process.h:808
int childOutput(int fdno)
Called by slotChildOutput() this function copies data arriving from the child process' stdout to the ...
Definition: k3process.cpp:762
void slotChildOutput(int fdno)
This slot gets activated when data from the child's stdout arrives.
Definition: k3process.cpp:659
void clearArguments()
Clear a command line argument list that has been set by using operator<<.
Definition: k3process.cpp:234
static QDebug kWarning(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
static K3ProcessController * instance()
Only a single instance of this class is allowed at a time.
Definition: k3processcontroller.cpp:83
virtual void commClose()
Cleans up the communication links to the child after it has exited.
Definition: k3process.cpp:959
void setUsePty(Communication comm, bool addUtmp)
Specify whether to create a pty (pseudo-terminal) for running the command.
Definition: k3process.cpp:717
static QString quote(const QString &arg)
This function can be used to quote an argument string such that the shell processes it properly...
Definition: k3process.cpp:735
The application is notified when the subprocess dies.
Definition: k3process.h:174
KAction * close(const QObject *recvr, const char *slot, QObject *parent)
virtual bool start(RunMode runmode=NotifyOnExit, Communication comm=NoCommunication)
Starts the process.
Definition: k3process.cpp:1046
The application does not receive notifications from the subprocess when it is finished or aborted...
Definition: k3process.h:170
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:51:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:51:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.