Skip to content
Advertisement

Tag: posix

How to find which process owns the named posix semaphore lock? [closed]

Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 4 years ago. Improve this question I used named semaphore to synchronize multiple processes in my system. One of

What type of memory objects does `shm_open` use?

Usually, shared memory is implemented using portions of On-Disk files mapped to processes address spaces. Whenever a memory access occurs on the shared region, the filesystem is involved to write changes on the disk which is a great overhead. Typically, a call to fopen() returns a file descriptor which is passed to mmap() to create the file’s memory map. shm_open,

How to ensure a posix c socket is still valid

I,m working on an embedded linux kernel 2.6 device and need to know if previously established socket is still valid or not,Also I can not do this with usual send function and check the returned value,because if I send to the invalid socket descriptor,my application will crash and linux will shut down my process.Is there any other function/suggestion for this

Why sem_t pointer have to start at multiple of 4 offset?

When you accessing block of memory (f.e. in real case using mmap) correct pointer for sem_t have to by multiple of 4. If it is not, then sem_init() still doesn’t return -1 (error value), but sem_t isn’t valid. Why it is working like this? Below code that is showing behaviour of semaphores. Answer ALL1 types in C may have alignment

Trimming string up to certain characters in Bash

I’m trying to make a bash script that will tell me the latest stable version of the Linux kernel. The problem is that, while I can remove everything after certain characters, I don’t seem to be able to delete everything prior to certain characters. Somehow the output “ignores” the wget=${wget##.tar.xz”>} line. Answer You’re trying remove the longest match of the

Why makecontext’s func only accepts integer arguments

The man page for makecontext states that the arguments after argc should be integer(int) only: …the function func is called, and passed the series of integer (int) arguments that follow argc If we look at pthread_create or clone system call, they have one void* argument which is to passed to the func, and a pointer of struct can contain any

Advertisement