system-calls

Using ptrace to write a program supervisor in userspace.

I'll looking for advice/resources to write a program that can intercept system calls from a programm to supervise it's filesystem, network, etc access. The aim of this is to write an online judge, so that untrusted code can be run safely on a server. This is on linux, and I would prefer to write C++ or a scripting langauge (ruby, pytho...

What system calls to block/allow/inspect to create a program supervisor.

Hi, as per http://stackoverflow.com/questions/3642370/using-ptrace-to-write-a-program-supervisor-in-userspace, I'm attempting to create the program supervisor component of an online judge. What system calls would I need to block totally, always allow or check the attributes of to: Prevent forking or runing other commands Restrict to s...

What's wrong with these system calls?

I'm at a loss debugging this code. I copied the example from a guide, is this file being improperly indexed? #include <sys/types.h> #include <unistd.h> #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> char *inicio(void); main(void) { char *c; int fd, sz, i; c = inicio(); fd ...

How can I make the system call write() print to the screen?

For my OS class I'm supposed to implement Linux's cat using only system calls (no printf) Reading this reference I found it being used to print to a file. I guess I should manipulate ofstream. In the example appears: ofstream outfile ("new.txt",ofstream::binary); How can I make it write to the screen? EDIT: I realized this write() is...

Using system calls to implement the unix cat command.

For my OS class I have the assignment of implementing Unix's cat command with system calls (no scanf or printf). Here's what I got so far: (Edited thanks to responses) #include <sys/types.h> #include <unistd.h> #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> main(void) { int fd1; ...

man 2 stat - how to figure out if a file is a link

I have the below code only a part of it is shown here and I am checking if a the type of file. struct stat *buf /* just to show the type buf is*/ switch (buf.st_mode & S_IFMT) { case S_IFBLK: printf(" block device\n"); break; case S_IFCHR: printf(" character device\n"); break; case S_IFDIR:...

DTExec will not run without a window

I am running SSIS from a C# application. I would like to run the SSIS process using the dtexec utility but without showing the dtexec window when running. I have set the ProcessStartInfo.CreateNoWindow to true yet dtexec still displays the window. I assume this is due to dtexec and not C#, but I cannot find a argument for dtexec that ...