Questions tagged [posix]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
70 views

Designing a logic to receive ACK for every message sent in a non-blocking way

This is more of a design/architecture question: I have got a timer based scheduler which informs the client of what and when to run next on its end. For which, I created a priority queue based timer ...
0
votes
1answer
84 views

Help architect a timer-based scheduler

I am writing a timer-based scheduler to accomplish the task of informing a certain process of what to do and when. The Idea: Inform an X process of certain requests to perform at timed-intervals. So ...
2
votes
0answers
58 views

Origin of the strftime %c format field order in POSIX locale

In standard POSIX locale strftime(buf, size, "%c", time) will format the date and time in an order that has confused me a number of times because it has month and day precede the time, but ...
-1
votes
3answers
208 views

Is it possible to solve this synchronization problem using mutex and conditional variables?

I am trying to solve this synchronization problem in C to practice for my lectures of Operating Systems where we use POSIX and Linux. I've been trying for days to find an approach to this problem with ...
-1
votes
1answer
62 views

Creating a "lite" version of shared library on Linux/POSIX in addition to full version

I have a large shared library, a collection of functions created from numerous .a files into libeverything.so. The code for the .a files is obviously compiled with -fPIC. I also have libeverything.a ...
0
votes
2answers
398 views

copying of memory vs pointer to memory in real time systems

While working in a multi-threaded environment, then data sharing seems to be a good option to pass data between threads. While working with real time systems it is apparently advisable to go with ...
3
votes
1answer
198 views

Simple solution for calling a function only on one thread, queuing waiting calls?

Let’s assume there is a function EventHandler that is called on multiple threads at different points in time. EventHandler has to call SomeOtherFunction, but these calls shall only happen on one ...
1
vote
1answer
1k views

What is the advantage of POSIX queue or just normal data structure queue?

I'm programming with the embedded device running Linux, where memory is less, I just have 64MB flash only. I planned to use queues for the thread communication. In which I came across with using ...
1
vote
2answers
63 views

Can packet sizes be relied upon in TCP/IP, at least for the first read() call on a connection?

Assume you have a client application which is known to connect to a given IP, and send a fixed size message (of size X = ~dozen bytes) upon connection, and wait for a reply. If you're writing a ...
2
votes
2answers
137 views

algorithm for shell language interpreter to find if a char is between quotes

Assume we have a string s (a C char *) that is a program in a language L. I want to parse L and know the following from the specification The following characters must be quoted if they are to ...
-2
votes
1answer
249 views

For loop and recursion for a new shell in C [closed]

I code a new shell in C, that could be done in several ways: Flex/bison, finite state machine, abstract syntax tree or just a tokenizer in C. Now I've written a for-loop that changes the condition of ...
0
votes
1answer
301 views

Using syscalls to read files - is this bad?

I have some (presumably stable) legacy C code that uses POSIX system calls to read binary files. It's nothing more than creat(), read(), and write(). The program doesn't sit close to the metal at all (...
10
votes
2answers
526 views

Why do programmers define programming models to replace C/POSIX for parallelism?

Providers of new computer architectures regularly try to introduce new programming models, e.g. recently CUDA/OpenCL for GPGPUs, and displace C/POSIX as the control interface to platform ...
2
votes
3answers
503 views

long (or bizarre) file paths

I know that (on Linux at least, with native file systems like Ext3) file paths can in theory be quite long, and PATH_MAX is often (but not always) as big as 4096 (see this; and this explains it could ...
2
votes
1answer
99 views

Ensuring reliability of cross-compilation

Provided that my code is fully standards compliant with no undefined behaviour, how can I best assure that it will be possible to cross-compile my software for any architecture? I had some ideas, but ...
13
votes
2answers
8k views

Proper way of handling EINTR in libraries

What is the recommended etiquette when it comes to EINTR in libraries? I'm currently writing a function that does some file system tasks with the POSIX API, but a lot of the calls I use can ...