Skip to main content

Questions tagged [posix]

POSIX (Portable Operating System Interface) is a set of standards defining programming APIs, a command interpreter, and common utilities for Unix-like operating systems.

-1 votes
1 answer
47 views

Can pthread_cond_wait() be called with read-write lock?

I know pthread_cond_wait() shall be used with mutex, but I'm curious if it can be used with rwlock. I read manual page of pthread_cond_wait() and it didn't say anything about using read-write lock, ...
Anderson Chris's user avatar
2 votes
0 answers
38 views

Attempting to write to disk and check the before and after availability of space using statvfs, but I see no change in blocks available

I am using statvfs to monitor my disk space. I run this program and see no changes in the amount of available blocks within my system, but when I run the df command I am able to see that there's disk ...
Mr.Longbottom's user avatar
-4 votes
0 answers
62 views

negative value in __writer member variable of struct pthread_rwlock_t [closed]

I am debugging one deadlock case in my application running on RHEL 7(glibc 2.17). When inspecting using gdb, at the time of deadlock, I see the following values on printing std::shared_timed_mutex(...
Vishal Sharma's user avatar
-1 votes
0 answers
70 views

Reading and writing the same file with different file handles

I apologize if this is a duplicate question. OS/Language: C++ 11/14 Linux (Rocky 4.18.0-425.3.1.el8.x86_64) libc.so.6 Use Case: Application has two threads, one writes ~7K data (text appended with a ...
Abhijit Dutta's user avatar
1 vote
3 answers
67 views

sed - Posix compliant generic multiple insert/appends single command

I'd like to perform multiple inserts/appends in a single sed command that is portable. In GNU sed, I can do something like: sed -e '1i hi' -e '$a bye' <(seq 1 10) I've the found the following works,...
Adam D.'s user avatar
  • 191
2 votes
2 answers
131 views

Repeated short identical parallel jobs

I have an algorithm that requires many parallel reruns of the same code. The code is short and finishes in less than a microsecond. This will be run millions of times which creates some problems when ...
user2908112's user avatar
0 votes
0 answers
18 views

Where should a binary file that must be executed by another program be stored on a UNIX system?

I am writing a program that uses a library which requires that my program be called by a driver which initializes the environment etc first. This is done by passing the path of my executable (or just ...
user21749640's user avatar
1 vote
0 answers
89 views

Problem with malloc and shared memory in C

I am trying to put shared_pid_data in shared memory. I need to have a dynamic array, so I use malloc, I also tried using calloc getting the same result. The problem I am encountering is that the data ...
MiusiZ's user avatar
  • 203
1 vote
1 answer
55 views

File created with fmemopen has no contents after writing

I have some files on disk that I want to read in and concatenate. I don't want to create a new temporary file on disk. So I decided to use fmemopen to read/write to memory and access it using FILE ...
Nate's user avatar
  • 161
0 votes
1 answer
55 views

comparison operator syntax in posix shell

I'm trying to understand the grammar/syntax of the shell command language (to be able to parse it) and I cannot seem to find where the syntax of the comparison operations is defined. As an example: x=...
Jeffrey Bonde's user avatar
3 votes
1 answer
90 views

POSIX or Linux-specific method of connecting a readable file descriptor to a writable file descriptor?

I've got a file descriptor, which might've come from a socket, a pipe, or an actual file, that can be read from. I've got another file descriptor (again, might represent a socket or an actual file) ...
Logan R. Kearsley's user avatar
0 votes
3 answers
53 views

How can you force a blocked mq_receive call to give up?

I am trying to upgrade a messaging library from SYSV message queues to POSIX message queues. Unlike with SYSV queues, closing and/or deleting a POSIX message queue that is blocked in mq_receive() ...
Haydentech's user avatar
  • 1,150
0 votes
0 answers
66 views

Process synchronisation for different processes not working with 2 semaphores [duplicate]

I am trying to learn process synchronization , I am trying semaphore,to print odd and even numbers alternatively using 2 processes , one process will execute odd function and another process will ...
Pramod 's user avatar
1 vote
1 answer
60 views

For wrappers around syscalls that retry on EINTR, how many times does retrying make sense?

Often syscalls like write(2), read(2), close(2) et cetera fail due to being interrupted by a signal with the errno value EINTR (say the size of the terminal window changed and SIGWINCH was received), ...
Harith's user avatar
  • 7,235
1 vote
1 answer
63 views

Posix Timer timer is not accurate

I'm working on vxWorks 7. I've developed a class to implement POSIX timer. I'm working on a Real Time Process. The timer is designed to run in single-shot or periodic mode. The problem is I'm getting ...
Dark Sorrow's user avatar
  • 1,827

15 30 50 per page
1
2 3 4 5
408