573 questions
3
votes
2
answers
164
views
Handling Buffer Size Errors in strftime: ERANGE vs EOVERFLOW
I have an application where I need to generate date and time based on the locale using the strftime function provided by C's time.h:
#include <stdio.h>
#include <time.h>
#include <...
1
vote
1
answer
131
views
Can std::filesystem::path::wstring() modify errno?
I have a function that reports errno errors:
void reportError(int err, const std::wstring& fname);
The pattern of invocation goes like this:
int fd = open(fileName.c_str(), O_RDONLY);
if (...
0
votes
1
answer
151
views
Invalid argument errno 22 in socket programming (recv() function)
I'm writing a function to receive data from a socket, store it in a buffer, return the number of bytes that I read, and do some other checks. I could not debug it for a couple of days.
Unit test:
#...
0
votes
2
answers
186
views
non blocking udp socket recvfrom does not recieve
I have an assignment that asks me to set up a UDP server that accepts non blocking requests from multiple users without the use of select or fork.
Ok, neat challenge. My idea: let's create a non ...
0
votes
2
answers
380
views
While linking the assembly object file with GCC, relocation error occurs due to errno setting [duplicate]
as a school project I am asked to rewrite the write function in x86-64 assembly. There are some rules in this project. For example, just as write sets errno in case of an error, my write function ...
1
vote
3
answers
259
views
Understanding errno Codes: Need Assistance
I was looking at errno.h source code, to find how the variable errno is implemented, I was expected it to be int or something like that, but when I look into glibc errno.h file, I found this line:
/* ...
2
votes
1
answer
383
views
How to (correctly) use `ctypes.get_errno()`?
I'm trying to test some binary library with ctypes and some of my tests involve errno.
I'm therefore trying to retrieve it to check the error cases handling but when trying to use ctypes.get_errno() I ...
1
vote
1
answer
264
views
fopen returns null but errno = 0: success
I'm trying to write to a text file in C, which is in the same directory as main, but fopen keeps returning NULL. Most of the replies on here say to print the value of errno, but errno is 0 which is a ...
1
vote
2
answers
289
views
How can I force a call to read(2) to return EINVAL?
Context
I'm writing code that emulates one aspect of pidfds on platforms that don't support them (old Linux, other Unix).
I'm doing this a) in order to test some pidfd-related code on very old ...
3
votes
1
answer
353
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), ...
0
votes
2
answers
1k
views
"[Errno 22] Invalid argument" while trying to run a .py file on Windows
I am reaching out due to an issue while trying to run a ".py" file on Windows 11.
After entering this on the command prompt:
py \C:\Users\ibrah\AppData\Local\Programs\Python\Python3.12\...
2
votes
0
answers
56
views
Node: Why are `os.constants.errno` values positive, while `util.getSystemErrorName` expects negative errnos?
All the values in os.constants.errno are positive, e.g.
{
E2BIG: 7,
EACCES: 13,
EADDRINUSE: 48,
EADDRNOTAVAIL: 49,
EAFNOSUPPORT: 47,
EAGAIN: 35,
EALREADY: 37,
EBADF: 9,
EBADMSG: 94,
...
0
votes
1
answer
68
views
Getting nltk certificate verify failed error with Visual Studio Code with Python3
I got this error. As you can see I have import nltk and nltk.download in my code per their guide.:
[nltk_data] Error loading words: <urlopen error [SSL:
[nltk_data] CERTIFICATE_VERIFY_FAILED] ...
0
votes
0
answers
186
views
OSError: [Errno 5] EIO : When using 2 of the same sensors with same address on different I2C channels
I'm using a Cytron Maker Pi RP2040
Micropython
The sensors are VL53L1X from Adafruit
Sensor0 is connected to (SDA1)-GPIO26, (SCL1)-GPIO27
Sensor1 is connected to (SDA0)-GPIO16, (SCL0)-GPIO17
I found ...
3
votes
1
answer
149
views
Why does NOT exist std::errno while "errno" does?
In order to make my codes more compliant with C++ style instead of C style, I want to replace errno with std::errno, and replace include <errno.h> with include <cerrno>.
To my supprise, ...