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
0
votes
1 answer

Unix system programming: get a network identifier to be passed to getaddrinfo

I am following on a book the code in C to build a server using system calls. The main function is the following: int main(int argc, char* argv[]) { printf("entered main\n"); struct addrinfo *ailist, *aip, hint; int sockfd, err, n; …
roschach
  • 8,390
  • 14
  • 74
  • 124
0
votes
1 answer

SIGHUP signal handling to deamonize a command in Unix system programming

I am reading a book about Unix system programming. In the book there is a function to create a daemon process. Part of the code is not very clear to me, particularly the following: struct sigaction sa; .... /* *Become a session leader to lose…
roschach
  • 8,390
  • 14
  • 74
  • 124
0
votes
2 answers

How to make multiple child proccess pause until a signal is sent

I have a program with three child processes all doing the exact same thing with a fourth child process told send signals while the main function waits until the three child processes are complete. I am using an alarm signal as well as two user…
buddy
  • 21
  • 4
0
votes
0 answers

Effect of virtual memory on allocation of larger sum of pages

I apologize for the long question ahead but I needed to give some context to my problem. So I'm writing a logger in the Linux kernel to extract memory characteristics like virtual address, the physical address of pages etc. For sanity testing, I…
Pratik Sampat
  • 330
  • 1
  • 12
0
votes
1 answer

How can I use R to substitute base names of files in a script for CMD?

I would like to use R to go into a text document I have and iteratively substitute the base name of the files in the first two lines (input and output) with those from a list I have stored in R. The text file looks like this: parameter input…
hmnoidk
  • 545
  • 6
  • 20
0
votes
1 answer

Envp in execve() has no effect

The point of this code is to simulate a shell: 1) Ask for a command from stdin until CTRL+D is pressed or "exit" is entered as input. 2) Fork the process. 3) Parent waits for the command to be executed by the child. 4) Child executes the command. 5)…
0
votes
1 answer

Unable to print to file from shared object

I have seen questions similar to this one on here before but I was unable to solve my problem from the answers to those. I have a file libfoo.c from which I'm creating a shared object. Using gcc's __attribute__((constructor)), I'd like to print a…
Peter
  • 2,919
  • 1
  • 16
  • 35
0
votes
1 answer

Is it possible to create a user-defined datatype in a language like C/C++(or maybe any) from a string as user input or from file

Well this might be a very weird question but my curiosity has striken pretty hard on this. So here it goes... NOTE: Lets take the language C into consideration here. As programmers we usually define a user-defined datatype(say struct) in the source…
0
votes
1 answer

RFC /advice: On secure/unsecure rpc/event-stream protocol design

SSL seems quite bloated for what I want to do, and I have a passionate hatred for OpenSSL (NSS might be useable). I need to open a TCP channel between two nodes that will be used for RPC / encrypted RPC / Event streams / Encrypted event streams. I…
Hassan Syed
  • 20,075
  • 11
  • 87
  • 171
0
votes
1 answer

Why does the following C code skip the read() system call to execute the next write() system call?

My question is regarding Linux Systems Programming, specifically about the read and write APIs. I am writing a program that replicates a shell. It takes a string argument and tokenizes it with a space delimiter. Depending on the command of the first…
0
votes
0 answers

Rlogind in freebsd

I am working on rlogind in freebsd. Code : https://searchcode.com/codesearch/view/469891/ I was just wondering why are they using the socket descriptor number 0 in setsockopt and getpeername in lines 167 -181? I had one other doubt in line 276.…
0
votes
1 answer

Is there any way for ioctl() in linux to specify submission queue ID for a nvme IO request

I am working on a testing tool for nvme-cli(written in c and can run on linux). For SSD validation purpose, we are actually looking for sending I/O commands to a particular Submission queue(IO Queue pair). We needed this because we wanted threading,…
0
votes
1 answer

How does a ioctl() call the driver code

I am working on a testing tool for nvme-cli(written in c and can run on linux). For SSD validation purpose, i was actually looking for a custom command(For e.g. I/O command, write and then read the same and finally compare if both the data are…
Arjun G S
  • 23
  • 13
0
votes
0 answers

Is there a way to have a ioctl() with new(customized) command

I am working on a testing tool for nvme-cli(written in c and can run on linux). For SSD validation purpose, i was actually looking for a custom command(For e.g. I/O command, write and then read the same and finally compare if both the data are…
0
votes
1 answer

Can I invoke same system calls with different threads using openmp or pthreads

I am working on a testing tool for nvme-cli(written in c and can run on linux). I am interested in repeating a nvme command 'r' number of times with 't' number of threads. The below code does the repeat of each command along with threading, but the…