Questions tagged [systems-programming]

System programming is the activity of computer programming system software. The primary distinguishing characteristic of systems programming when compared to application programming is that application programming aims to produce software which provides services to the user, whereas systems programming aims to produce software which provides services to the computer hardware.

Wiki:

System programming is a kind of computer programming which is intended to design a system software. Systems programming is used to produce such softwares which provide services to the computer hardware. thus It requires a greater extent of hardware compatibility.

Implementing certain parts in operating system and networking requires systems programming, for example implementing Paging (Virtual Memory) or a device driver for an operating system. A System programming language like C, PL360, BLISS, D is usually used to for systems programming".

Usage:

The tag can be used for all system programming related problems. Stackoverflow is a question-answer website for programming related problems, for theoretical and other problems you can ask your system programming problems on https://www.superuser.com and https://programmers.stackexchange.com/

Read more:

408 questions
3
votes
2 answers

system call return values and errno

I am using following system calls in my program: recvfrom sendto sendmsg And from each system call mentioned above I check if it completes with out any interruption and in case if it is interrupted, I retry. Ex: recvagain: len =…
Ram
  • 1,153
  • 4
  • 16
  • 34
3
votes
1 answer

Checking for installed signal handler

I have a library which installs a signal handler for SIGSEGV for debugging purpose. The SIGSEGV handler just prints some information and then exits the program. Recently, I had the need to invoke this library from Java (using JNI), and the problem I…
Saurabh
  • 1,059
  • 10
  • 20
3
votes
3 answers

sys/stat S_ISDIR(m) with struct dirent

I want to check to see if a file is a directory, link, or just a regular file. I loop through the directory and save each file as struct dirent *. I try to pass d_ino to S_ISDIR(m), S_ISLINK(m), or S_ISREG(m) and regardless of the file, I will not…
Joe Tyman
  • 1,417
  • 5
  • 28
  • 57
2
votes
2 answers

System programming in Ubuntu

[Question moved in from askubuntu.com] I'd like to get into Ubuntu systems programming; to be specific - developing and debugging device drivers. However, I'm not sure about how to get started, even though I have prior experience contributing to…
user277465
2
votes
1 answer

How is tcgetsid different than getsid function?

While reading "Advanced Programming in the Unix Environment", it appears to me that those two functions do exactly the same thing. They both return the same result to the calling process. So why bother design two of them? Thanks larsmans. But if a…
Rui Liu
  • 376
  • 4
  • 9
2
votes
2 answers

sigaction system call: what if sa_mask includes one of the blocked signals?

The sa_mask field of struct sigaction specifies signals that are blocked during handler invocation. Those signals are added to the process block mask just before the handler is invoked and removed right after handler completion. What if sa_mask and…
pic11
  • 14,267
  • 21
  • 83
  • 119
2
votes
1 answer

How to pass Multiple inheritable handle values to a child process...?

In windows process management, if we want to pass the values of more than one inheritable handle to a child process, how should it be done.. ? I understand that we can use STARTUPINFO to pass one handle value, but how can I pass multiple handle…
psaw.mora
  • 868
  • 1
  • 7
  • 18
2
votes
1 answer

Using the stdout and stdin with System.IO.runCommand

I am trying to capture the stdin and stdout from runProcess into a string for analysis. However, setting up the handles seems to be rather difficult. I wandered into GHC.IO.Handle, and that seems to be the logical destination, but it seems that…
Paul Nathan
  • 39,638
  • 28
  • 112
  • 212
2
votes
1 answer

Get Filename from External Process File Handle for Win64bit - C#

can somebody please help me. I want to get the filename that corresponds to a file handle of an external process. Currently i managed to do that only on Win32bit and not Win64bit. Is code signing required to do that in Windows 64bit ? Thanks !
alexandertr
  • 943
  • 1
  • 9
  • 18
2
votes
2 answers

Should fsync() be called before or after write() call?

I understand the working of write() call wherein it writes the data only to kernel's buffers which is later written to disk by kernel after sorting the data optimally. Calling fsync() on file descriptor makes sure that data is written to disk as…
2
votes
1 answer

How do I run in chroot environment temporarily in a C program?

What I'm trying to do is essentially as follows: some_function_1(); chroot("/some_other_root"); some_function_2(); //Get back to main root somehow... some_function_3(); So that only some_function_2() runs in the chroot environment, but other code…
Rocky Pulley
  • 22,531
  • 20
  • 68
  • 106
2
votes
0 answers

Interprocess communication between c code and python

I am trying to plot data related to CPU usage and memory usage in real time on graph. I am reading data using a c code and transferring it to python script using pipes. Now I want to be able to execute the python script directly from the C program…
2
votes
1 answer

What is related and unrelated processes?

Can someone please clarify the definition of related and unrelated processes? I know that fork creates two related processes fork() However, I am not sure whether the process is still considered related when we call exec* family functions to…
Validus Oculus
  • 2,756
  • 1
  • 25
  • 34
2
votes
1 answer

Linux kernel_write function returns EFBIG when appending data to big file

The task is to write simple character device that copies all the data written to the device to tmp a file. I use kernel_write function to write data to file and its work fine most of the cases. But when the output file size is bigger than 2.1 GB,…
VGG
  • 23
  • 4
2
votes
0 answers

PTRACE_SETOPTIONS with PTRACE_O_EXITKILL not working: invalid argument

I'm learning how to use ptrace and wrote some code to test it out. However, I am getting a problem when I am trying to use the PTRACE_SETOPTIONS request to set the PTRACE_O_EXITKILL option to kill the tracee process if the tracer process…
NotAPro
  • 136
  • 2
  • 17