Questions tagged [errno]

errno is an integer variable, which is set by system calls and some library functions in the event of an error to indicate what went wrong. Its value is significant only when the return value of the call indicated an error.

errno is an integer variable, which is set by system calls and some library functions in the event of an error to indicate what went wrong. Its value is significant only when the return value of the call indicated an error.

559 questions
11
votes
1 answer

ValueError:PyCapsule_GetPointer called with incorrect name with

This is already solved by myself but I put this question for someone else. I think this kind of problem is better as much as we can. and there doesn't seem be in SOF. I updated spyder. conda update spyder Collecting package metadata: done Solving…
Haru
  • 1,884
  • 2
  • 12
  • 30
11
votes
7 answers

Python ConnectionRefusedError: [Errno 61] Connection refused

Ive seen similar questions but they I couldn't fix this error. Me and my friend are making a chat program but we keep getting the error ConnectionRefusedError: [Errno 61] Connection refused We are on different networks by the way. Here is my…
Stan Theo Hettinga
  • 119
  • 1
  • 1
  • 3
11
votes
2 answers

SO_ERROR vs. errno

For getting socket syscall (like recv) error, which is better (at performance level) ? Use the plain old errno Or use SO_ERROR as getsockopt() optname ? I think errno (defined to __error() on my system) is faster because it's not a system call. Am…
Félix Faisant
  • 191
  • 1
  • 1
  • 11
11
votes
5 answers

C fopen fails for write with errno is 2

I do not understand why this is seemingly failing with errno of 2: char debugText [256]; sprintf (debugText, "C:\\List.txt"); dfile = fopen( debugText, "w"); fprintf ( dfile, " err %d \n", errno); I say seemingly because while dfile is NULL the…
JPM
  • 445
  • 1
  • 5
  • 15
10
votes
3 answers

python: zipfile.ZipFile No such file or directory

There is folder path: P:\\2018\\Archive\\ There are many zipfiles I want to create programmatically, but am starting with test. I will name this test zip file "CO_007_II.zip" and will attempt to create in above location: import zipfile as zp with…
geoJshaun
  • 637
  • 2
  • 11
  • 32
10
votes
2 answers

What's the semantic difference between ERANGE and EOVERFLOW?

The errno value ERANGE is documented by POSIX as Result too large. and EOVERFLOW is documented as Value too large to be stored in data type. What's the semantic difference between these two? Especially considering that ERANGE is used by ISO 9899…
fuz
  • 88,405
  • 25
  • 200
  • 352
10
votes
2 answers

EWOULDBLOCK equivalent errno under Windows Perl

G'day Stackoverflowers, I'm the author of Perl's autodie pragma, which changes Perl's built-ins to throw exceptions on failure. It's similar to Fatal, but with lexical scope, an extensible exception model, more intelligent return checking, and…
pjf
  • 5,993
  • 25
  • 42
10
votes
2 answers

Does stdio always set errno?

When a stdio stream encounters an error (but not EOF), the stream's error indicator will be set so that ferror() will return nonzero. I have always assumed that more information is available in errno. But how do I know this? Documentation for some…
Adrian Ratnapala
  • 5,485
  • 2
  • 29
  • 39
9
votes
2 answers

Unexpected flow of control (compiler-bug?) using errno as argument for exception in C++ (g++)

When using C++ exceptions to transport errno state, the compiled code that gets generated by g++ (4.5.3) for code such as the following #include #include #include class oserror : public std::runtime_error { private: …
modelnine
  • 1,499
  • 8
  • 11
9
votes
2 answers

Why can't you just check if errno is equal to ERANGE?

I've been trying to properly convert a char array to a long with strtol, check if there was an overflow or underflow and then do an int cast on the long. Along the way, I've noticed a lot of code that looks like this if ((result == LONG_MAX ||…
Luis Averhoff
  • 887
  • 2
  • 11
  • 22
9
votes
6 answers

Where can I see the list of functions that interact with errno?

In the book "The C Programming Language" it says: "Many of the functions in the library set status indicators when error or end of file occur. These indicators may be set and tested explicitly. In addition, the integer expression errno (declared …
Ori Popowski
  • 10,432
  • 15
  • 57
  • 79
8
votes
1 answer

Error file_get_contents(): read of 8192 bytes failed with errno=21

I have a simple script, that searches inside every file of every subfolder for a given string. It worked just fine, until I believe my PHP got updated (I'm not pretty sure if it was because of that). This is the code:
Nikolai Nikolaew
  • 101
  • 1
  • 1
  • 4
8
votes
2 answers

Is it required for me to add a _REENTRANT macro during compile time to make my errno thread safe?

Is it required for me to add a _REENTRANT macro during compile time to make my errno thread safe? If no, is it the case for all versions of gcc / linux / solaris or is it required for certain old versions? I recently tested a piece of code where…
Jay
  • 24,173
  • 25
  • 93
  • 141
8
votes
1 answer

Which functions are affected by -fno-math-errno?

I have been excited by this post: https://stackoverflow.com/a/57674631/2492801 and I consider using -fno-math-errno. But I would like to be sure that I do not harm the behaviour of the software I am working on. Therefore I have checked the (rather…
Benjamin Bihler
  • 1,612
  • 11
  • 32
8
votes
3 answers

I keep getting `errno 4058` from npm

I used npm in the last weeks without any problems, but all of the sudden i keep getting this error: npm ERR! path J:\Work\Web_server\create_file\node_modules\depd npm ERR! code ENOENT npm ERR! errno -4058 npm ERR! syscall rename npm ERR! enoent…
Ezeeroc
  • 185
  • 2
  • 4
  • 14