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
1
vote
1 answer

How does domain specific language help in bridging semantic gap?

I was reading about system programming when I came across the semantic gap and how we have to bridge that for better software development. Then the term programming language domain came in which apparently bridges the semantic gap but getting in the…
tanvi
  • 17
  • 4
1
vote
1 answer

How does fork return a Pid?

I am trying to understand under the hood how does fork return the process id of the child since the child method has not returned, nor does it send by other mechanism its id to the parent. At the lowest level, I do not understand if lets say the…
Bercovici Adrian
  • 8,794
  • 17
  • 73
  • 152
1
vote
1 answer

Segmentation error Linux File I/O in c by cli input

I was trying to code a c program that is given the name of a file by Command line and then opens the nano editor on the file through a system() call. After having edited and saved the file, the c program sorts the file by first reading the file,…
1
vote
2 answers

How is system call return value passed back to user process?

Assume we have a single core cpu running int filedesc = open("foo.txt", O_RDONLY); filedesc is a variable in user process, when open begins to be executed cpu gets context switch and runs kernel process, how is the return value of open be passed to…
mzoz
  • 1,273
  • 1
  • 14
  • 28
1
vote
2 answers

what is initial value of pid_t with char array?

while I am trying to understand processes I noticed something int main(){ pid_t pid,w; printf("value of w: %d\n", w); return 0; } When I run the above code, the value of w is 0. So far no problem. BUT when i added char array in the code like…
ismet
  • 39
  • 7
1
vote
0 answers

inode number is changed suddenly at certain location in c programming on linux

#include #include #include #include #include #include #include #include void creatEnv(); char *mygetcwd(char *buf, size_t size) { DIR *dirp_p,…
ben kwon
  • 61
  • 4
1
vote
1 answer

Does bind() modify sin_port in C?

Does the bind() function in linux can modify its argument ? I ask this because a sin_port of 0 means that the OS will choose the port, and I would like to get this port after this call.
rafoo
  • 1,506
  • 10
  • 17
1
vote
1 answer

Is there a way club two Linux command together in system() function in C?

I wanted to execute who command and cut out the needed info like who | cut -d " " -f 1,21,23 but by using the system() function in c. I tried doing system("who | cut -d " " -f 1,21,23") which did not work. The…
1
vote
1 answer

Treating signals correctly inside system()

I have been reading "The Linux Programming Interface". Chapter 27, Program execution. I understand that the author demonstrates how we could implement the system call using exec and fork. However, the challenging part is handling signals. In…
storm
  • 795
  • 1
  • 5
  • 12
1
vote
1 answer

i cant get my program to work i keep getting undefined symbol: c

I'm trying to load all the libraries, and call a function from each one, to create a file and shate the fiddle thru the pointer, and write stuff in the main program with them, the close them. This is my main function: #include #include…
AntiMutex
  • 15
  • 3
1
vote
3 answers

pthread_cond_wait blocks(sleeps) indefinitely until pthread_cond_signal is called by another thread in C?

If a thread: A is blocked in pthread_cond_wait for a condition, will our thread A will be sleeping indefinitely waiting for pthread_cond_signal being called in another thread? Or it will be woken up even when the condition somehow becomes true…
Cliff
  • 140
  • 1
  • 8
1
vote
0 answers

Is there any way to check the maximum number of concurrent tcp connections a web server supports remotely?

I was wondering if I could write a C socket program to remotely check the number of TCP connections a web server can accept concurrently. A naive solution which I came up with is to keep calling connect() to the server port in a loop till I get a -1…
yobro97
  • 1,125
  • 8
  • 23
1
vote
0 answers

Automatic subdir and file creation in C

I want to create some files inside a directory in C with minimal code size. For example, if my current directory is foo and I want to create foo/bar/file1.txt, I can not use fopen("bar/file1.txt", "w"); to create the bar/ directory and the file in…
George Sp
  • 553
  • 5
  • 20
1
vote
0 answers

How to set the FIFO size maximum in C?

I create a named pipe with mkfifo(2) . But I want to set its size to maximum. I use fnctl() and PIPE_BUF but I think I couldn't do that. This is my piece of code: #define PIPE_BUF 1048576 #define _GNU_SOURCE int writeSomeStuffToFifo (){ int…
javac
  • 441
  • 4
  • 20
1
vote
1 answer

Where are System Call IDs defined for x86 arch in Linux Kernel 5.0.1?

I am following a Linux System Programming Video Tutorial. When I reached "how to add your own Linux System Call" section, the instructor shows that all System Call IDs (macros starting with __NR) are present in arch/x86/include/asm/unistd_32.h or…
user9293205