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

Using pa_simple api efficiently

I'm playing around with pa_simple api to get a better understanding of digital audio. I've written some code to feed custom generated audio data to the pulseaudio server: char buff[2]; while (playing) { timePassed += periodMicros; int val =…
saga
  • 1,933
  • 2
  • 17
  • 44
1
vote
2 answers

Strange behavior of dup system call

So, I was reading about File I/O in Linux and thought of playing around with it. However, I encountered two strange behaviors in the code and I am struggling to find out a reason for them. /* * This program shows the usage of dup and dup2…
Crazy Psychild
  • 552
  • 5
  • 16
1
vote
2 answers

What is the use of ATOM returned by RegisterClassEx function?

I was reading the documentation of RegisterClassEx function and found that the return type of the function is ATOM. ATOM RegisterClassEx(CONST WNDCLASSEX *lpwcx); While creating a window using CreateWindowEx we can either pass the classname or ATOM…
Searock
  • 6,278
  • 11
  • 62
  • 98
1
vote
1 answer

How do I make sure that file handle for every `Child` process is released after every iteration?

I have the following program taken from the Rust docs for std::process::Command. It stops working after some iterations. use std::process::Command; use std::process::Stdio; fn main() { loop { let mut echo_child = Command::new("echo") …
rusty doe
  • 23
  • 2
1
vote
1 answer

Is there any alternative for ioctl() in linux to interact with nvme drives

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,…
1
vote
0 answers

Can I invoke ioctl() (system call) for nvme with different threads using 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 a command along with threading, but the…
Arjun G S
  • 23
  • 13
1
vote
3 answers

CHMOD vs UMASK - Linux file permissions

In a script, should I create a file first and then, use CHMOD to assign permissions (Example- first using TOUCH command to create a file and then, using CHMOD to edit permissions on that file) "OR" should I mask permissions using UMASK as I create a…
sulabh chaturvedi
  • 3,608
  • 3
  • 13
  • 25
1
vote
0 answers

process exit automatically when signal delivered before pthread_cond_wait

#include "apue.h" #include int quitflag; sigset_t mask; pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t wait = PTHREAD_COND_INITIALIZER; void * thr_fn(void *arg) { int err, signo; for ( ; ; ) { err…
1
vote
1 answer

Image capture at the time of windows login

I want to know how i can capture image from webcam when a user success or unsuccessfully make login attempt in windows. Is any API for .net available for this purpose or any way to do this.
Raj
  • 3,890
  • 7
  • 52
  • 80
1
vote
1 answer

What is the POSIX call to determine the intended IP of a redirected socket open request?

I am modifying my hosts file to change the IP address of (for example a database call) to a local proxy that I am writing. 10.1.2.3 localhost 10.1.2.4 localhost I want the proxy listening on the socket to work out which machine the socket opening…
1
vote
0 answers

When and How can a child kill? (Fork)

I'm wondering that, when I'm using fork and creating several children and then the children are creating several children. What should I do when a child finishes its task? void foo(){ pid_t childpid = 0; . . . while (..){ …
jundo
  • 66
  • 1
  • 10
1
vote
2 answers

Create a chain of n sub processes

In c++ create chain of n processes with n as input and the output of processes should be as parent1->child1(parent2)-->child2(parent3),by using recursive function im able to generate the output but unable to exit the loop i also need help in sending…
Raj
  • 35
  • 1
  • 7
1
vote
0 answers

Setting alignment in source-data for optimal loading into memory?

When defining a stream of data for a program to read into memory (a file format for e.g. but could be any other kind of data streamed into memory). How should the data be alignment for optimal memcpy? While memcpy doesn't require alignment, I've…
ideasman42
  • 42,413
  • 44
  • 197
  • 320
1
vote
0 answers

libnl-3 neighbor cache - rtnl_neigh_alloc_cache called for multicast address

I am running OSPF protocol on the linux box and "ip neighbor show " lists the below hosts connected to it. 10.11.15.185 dev eth0 lladdr 52:54:00:48:d1:89 STALE 172.31.2.100 dev veth5 lladdr 00:02:00:00:00:01 STALE 10.11.0.1 dev eth0 lladdr…
dd76
  • 37
  • 1
  • 3
1
vote
1 answer

I would like to obtain time (ctime(..)?) of a file in host language

I have a function like this: void ft_display_time(struct timespec ttime) { char *time_long; time_long = ctime(&ttime.tv_sec); if (time_long) { ft_printf("%.3s ", time_long + 4); ft_printf("%.2s ", time_long +…
LotoLo
  • 327
  • 4
  • 17