systemcall

How to find which process the linux os running at a given moment ?

So a OS multi-tasks and runs one process at a given moment (assuming it's a single core machine). Is there a way I can track/poll and find which process was running at what time and at what time it was put in the queue and retrieved back. Are there any system calls for this ?. Is there a way to achieve this without modifying the linux ke...

How to call c++ functionality from java

I have a Java program that is mostly GUI and it shows data that is written to an xml file from a c++ command line tool. Now I want to add a button to the java program to refresh the data. This means that my program has to call the c++ functionality. Is the best way to just call the program from java through a system call? The c++ progr...

What does readlink systemcall do?

I can't understand the operation of the "readlink" systemcall in Linux. Can anyone explain about it with simple example on it? ...

Configuring kernel

After create a new system call, how to update the kernel? I tried these lines, make-kpkg clean fakeroot make-kpkg -initrd -append-to-version=-custom kernel_image kernel_headers But Ubuntu asked me if I am sure what I am doing, or not. But I am not sure. Do I have to say yes? Here is what did, Ubuntu said to me: You are attemptin...

Supress console when calling "system" in c++

I'm using the system command in C++ to call some external program, and whenever I use it, a console window opens and closes after the command finishes. How can I avoid the opening of a console window? I would be happy if the solution could be platform-independent. I would also like for my program to wait until the command is finished....

System call in unix: directories and files

hi I'm trying to understand system calls: directories and files on unix, .. I found this website where they explain some calls with their own examples, but do not understand these code snippets .. void state (char *file) { struct stat buf; struct passwd *pw; struct group *gr; int i; if (stat(file, &buf)...

Unix System Call in Objective-C

Hi all, Is it possible to make system call in Objective-C? I have the following code: if (!system("ls -l")) { NSLog(@"Successfully executed"); } else { NSLog(@"Error while executing the command"); } How to get the output? Thanks ...

What encoding used when invoke fopen or open?

When we invoke system call in linux like 'open' or stdio function like 'fopen' we must provide a 'const char * filename'. My question is what is the encoding used here? It's utf-8 or ascii or iso8859-x? Does it depend on the system or environment setting? I know in MS Windows there is a _wopen which accept utf-16. ...

what happens at the lower levels after a fork system call ?

I know what the fork() does at the higher level. What I'd like to know is this - As soon as there is a fork call, a trap instruction follows and control jumps to execute the fork "handler" . Now,How does this handler , which creates the child process, by duplicating the parent process by creating another address space and process cont...

System calls as part of Webservice

hello all, I am trying to use a software for converting one file format to another, and that I usually use on command line. The input for this software is a file with the content that I want to transform. I am trying to use this in my webservice. Can I use FileWriter and create a File into which I want to write the contents to be transf...

SystemParametersInfo parameter definitions for C#

I want to make a call to SystemParametersInfo from C#. The first argument to this function is one of a large collection of possible values like SPI_GETACCESSTIMEOUT, which are listed in the documentation, but don't seem to be defined anywhere. I can go find the actual values of these things on the web, and make up an enum with the right...

Porting C++-code from Windows to Unix: systemcalls colliding with name of functions

Hi I'm porting some crufty C++ Windows-code to Linux, which uses functions called "open" and "close" inside every class... Very bad style, or? Luckily that wasn't a problem in windows, since their systemcalls are named different. When I try to call the systemcalls open() or close() I'm getting some compiler error about "no matching fun...

How to find which type of system call is used by a program

I am working on x86_64 machine. My linux kernel is also 64 bit kernel. As there are different ways to implement a system call (int 80, syscall, sysenter), i wanted to know what type of system call my machine is using. I am newbie to linux. I have written a demo program. #include <stdio.h> int main() { getpid(); return 0; } getpid...

System calls on Windows

Hi, I just want to ask, I know that standart system calls in Linux are done by int instruction pointing into Interrupt Vector Table. I assume this is similiar on Windows. But, how do you call some higher-level specific system routines? Such as how do you tell Windows to create a window? I know this is handled by the code in the dll, but ...

which one faster, getimeofday or clock_gettime ?

I want to store event time. I found these two functions, but don't know which one is faster. ...

How do I compile .s assembly code in UNIX SPARC 64bit correctly?

Greetings all. Having problem trying to compile and run this "hello, wold" .s code in sparc UNIX 64bit environment and got $: "hello.s", line 1: error: invalid character (0xef) and etc. on other lines and addresses. Thought it was ANSI UTF issues, changed and saved and tried both types. Then tried to save file with ECO conversion to UNIX...

how to use "system call" to determine ethernet status on linux?

usually I use ping to determine ethernet status, like: ping -c 1 -w 1 <ip_addr> how could we use system call to determine ethernet status? and how could we embedded this method in java codes? ...

Creating new system calls via KLD in FreeBSD

Are there any good (entry-level) tutorials on adding system calls to FreeBSD via kernel loadable modules? Specifically, the required form of the methods, getting information from processes, etc. ...