tdeprocess.cpp
772 #if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__GNU__) && !defined(__DragonFly__)
882 kdWarning(175) << "Invalid usePty/communication combination (" << d->usePty << "/" << comm << ")" << endl;
Provides a high level representation of a pseudo tty pair, including utmp support.
Definition: kpty.h:40
virtual bool start(RunMode runmode=NotifyOnExit, Communication comm=NoCommunication)
Starts the process.
Definition: tdeprocess.cpp:1129
static void deref()
Destroy the instance if one exists and it is not referenced any more.
Definition: kprocctrl.cpp:48
void rescheduleCheck()
This function must be called at some point after calling unscheduleCheck().
Definition: kprocctrl.cpp:178
static TDEProcessController * theTDEProcessController
Only a single instance of this class is allowed at a time, and this static variable is used to track ...
Definition: kprocctrl.h:60
void unscheduleCheck()
Call this function to defer processing of the data that became available on notifierFd().
Definition: kprocctrl.cpp:170
TDEProcess & operator<<(const TQString &arg)
Sets the executable and the command line argument list for this process.
Definition: tdeprocess.cpp:287
virtual void processHasExited(int state)
Immediately called after a successfully started process in NotifyOnExit mode has exited.
Definition: tdeprocess.cpp:821
virtual int commSetupDoneC()
Called right after a (successful) fork(), but before an exec() on the child process' side.
Definition: tdeprocess.cpp:987
virtual int commSetupDoneP()
Called right after a (successful) fork() on the parent side.
Definition: tdeprocess.cpp:942
Communication communication
Lists the communication links that are activated for the child process.
Definition: tdeprocess.h:852
virtual bool start(RunMode runmode=NotifyOnExit, Communication comm=NoCommunication)
Starts the process.
Definition: tdeprocess.cpp:298
int childError(int fdno)
Called by slotChildError() this function copies data arriving from the child process' stderr to the r...
Definition: tdeprocess.cpp:859
void suspend()
Suspend processing of data from stdout of the child process.
Definition: tdeprocess.cpp:648
void processExited(TDEProcess *proc)
Emitted after the process has terminated when the process was run in the NotifyOnExit (==default opti...
bool keepPrivs
If false, the child process' effective uid & gid will be reset to the real values.
Definition: tdeprocess.h:734
void clearArguments()
Clear a command line argument list that has been set by using operator<<.
Definition: tdeprocess.cpp:293
virtual bool kill(int signo=SIGTERM)
Stop the process (by sending it a signal).
Definition: tdeprocess.cpp:493
bool wait(int timeout=-1)
Suspend execution of the current thread until the child process dies or the timeout hits.
Definition: tdeprocess.cpp:528
static TQString quote(const TQString &arg)
This function can be used to quote an argument string such that the shell processes it properly.
Definition: tdeprocess.cpp:809
void setEnvironment(const TQString &name, const TQString &value)
Adds the variable name to the process' environment.
Definition: tdeprocess.cpp:171
@ OwnGroup
Same as NotifyOnExit, but the process is run in an own session, just like with DontCare.
Definition: tdeprocess.h:187
@ DontCare
The application does not receive notifications from the subprocess when it is finished or aborted.
Definition: tdeprocess.h:174
@ Block
The application is suspended until the started process is finished.
Definition: tdeprocess.h:182
void setupEnvironment()
Sets up the environment according to the data passed via setEnvironment()
Definition: tdeprocess.cpp:183
void slotSendData(int dummy)
Called when another bulk of data can be sent to the child's stdin.
Definition: tdeprocess.cpp:745
TQValueList< TQCString > arguments
The list of the process' command line arguments.
Definition: tdeprocess.h:696
void setUsePty(Communication comm, bool addUtmp)
Specify whether to create a pty (pseudo-terminal) for running the command.
Definition: tdeprocess.cpp:790
int childOutput(int fdno)
Called by slotChildOutput() this function copies data arriving from the child process' stdout to the ...
Definition: tdeprocess.cpp:836
virtual void commClose()
Cleans up the communication links to the child after it has exited.
Definition: tdeprocess.cpp:1037
void resume()
Resume processing of data from stdout of the child process.
Definition: tdeprocess.cpp:654
void setWorkingDirectory(const TQString &dir)
Changes the current working directory (CWD) of the process to be started.
Definition: tdeprocess.cpp:177
virtual int setupCommunication(Communication comm)
This function is called from start() right before a fork() takes place.
Definition: tdeprocess.cpp:874
void slotChildError(int fdno)
This slot gets activated when data from the child's stderr arrives.
Definition: tdeprocess.cpp:738
void slotChildOutput(int fdno)
This slot gets activated when data from the child's stdout arrives.
Definition: tdeprocess.cpp:731
const char * input_data
The buffer holding the data that has to be sent to the child.
Definition: tdeprocess.h:871
bool setPriority(int prio)
Sets the scheduling priority of the process.
Definition: tdeprocess.cpp:210
void receivedStderr(TDEProcess *proc, char *buffer, int buflen)
Emitted, when output from the child process has been received on stderr.
bool signalled() const
Checks whether the process was killed by a signal.
Definition: tdeprocess.cpp:600
void wroteStdin(TDEProcess *proc)
Emitted after all the data that has been specified by a prior call to writeStdin() has actually been ...
bool setExecutable(const TQString &proc) TDE_DEPRECATED
Definition: tdeprocess.cpp:255
void setUseShell(bool useShell, const char *shell=0)
Specify whether to start the command via a shell or directly.
Definition: tdeprocess.cpp:765
void setRunPrivileged(bool keepPrivileges)
Controls whether the started process should drop any setuid/setgid privileges or whether it should ke...
Definition: tdeprocess.cpp:198
bool runPrivileged() const
Returns whether the started process will drop any setuid/setgid privileges or whether it will keep th...
Definition: tdeprocess.cpp:204
void setBinaryExecutable(const char *filename)
Specify the actual executable that should be started (first argument to execve) Normally the the firs...
Definition: tdeprocess.cpp:250
void receivedStdout(TDEProcess *proc, char *buffer, int buflen)
Emitted, when output from the child process has been received on stdout.
const TQValueList< TQCString > & args()
Lets you see what your arguments are for debugging.
Definition: tdeprocess.h:472