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
291
votes
15 answers

How to know what the 'errno' means?

When calling execl(...), I get an errno=2. What does it mean? How can I know the meaning of this errno?
Barth
  • 15,135
  • 20
  • 70
  • 105
206
votes
9 answers

How to create a file in Ruby

I'm trying to create a new file and things don't seem to be working as I expect them too. Here's what I've tried: File.new "out.txt" File.open "out.txt" File.new "out.txt","w" File.open "out.txt","w" According to everything I've read online all of…
Civatrix
  • 2,566
  • 4
  • 17
  • 16
151
votes
16 answers

Python [Errno 98] Address already in use

In my Python socket program, I sometimes need to interrupt it with Ctrl-C. When I do this, it does close the connection using socket.close(). However, when I try to reopen it I have to wait what seems like a minute before I can connect again. How…
skylerl
  • 4,030
  • 12
  • 41
  • 60
64
votes
1 answer

Python socket.error: [Errno 111] Connection refused

I am trying to write a program for file transfer using sockets. The server end of the code is running fine. However, in the client side I get the following error Traceback (most recent call last): File "client.py", line 54, in…
srnvs
  • 997
  • 2
  • 10
  • 22
62
votes
2 answers

What does this socket.gaierror mean?

I'm new to python and going through a book, Core Python Applications 3rd Edition. This is the the first example and already I'm stumped with it. Here's the code with the error at the end. #!/usr/bin/env python from socket import * from time import…
user2139635
  • 631
  • 1
  • 5
  • 5
62
votes
8 answers

MySQL: Error dropping database (errno 13; errno 17; errno 39)

I failed to drop a database: mysql> drop database mydb; ERROR 1010 (HY000): Error dropping database (can't rmdir './mydb', errno: 39) Directory db/mydb exists in mysql tree but has no table: # ls -l db/mydb -rw-rw---- mysql mysql…
Philippe Blayo
  • 10,610
  • 14
  • 48
  • 65
56
votes
2 answers

What's the meaning of the %m formatting specifier?

The output for this code printed out ‘Success’. printf("%m\n");
Manuel
  • 976
  • 3
  • 9
  • 21
53
votes
5 answers

Is &errno legal C?

Per 7.5, [errno] expands to a modifiable lvalue175) that has type int, the value of which is set to a positive error number by several library functions. It is unspecified whether errno is a macro or an identifier declared with external linkage. If…
R.. GitHub STOP HELPING ICE
  • 208,859
  • 35
  • 376
  • 711
49
votes
6 answers

Should I set errno?

I'm writing a module which exports an interface similar to send and recv. Since those functions are supposed to return respectively the number of sent and received bytes, I cannot do proper error management as I would do normally (i.e. using…
Dacav
  • 13,590
  • 11
  • 60
  • 87
48
votes
3 answers

How to set errno value?

I have two calls to two different methods : void func1() { // do something if (fail) { // then set errno to EEXIST } } And the second method : void func2() { // do something if (fail) { // then set errno to ENOENT …
JAN
  • 21,236
  • 66
  • 181
  • 318
45
votes
6 answers

How to convert errno in UNIX to corresponding string?

Is there any function in UNIX to the convert errno to its corresponding string for e.g. EIDRM to "EIDRM". Its very annoying to debug to check for errors with these integer errnos.
avd
  • 13,993
  • 32
  • 78
  • 99
42
votes
12 answers

Unable to run Protractor - ECONNREFUSED connect ECONNREFUSED

I'm trying to learn AngularJS. As part of this, I want to learn to use end-to-end testing. Currently, I have a directory structure like this: node_modules .bin ... protractor ... node_modules .bin adam-zip glob …
SL Dev
  • 855
  • 3
  • 11
  • 13
39
votes
5 answers

Cannot assign requested address - possible causes?

I have a program that consists of a master server and distributed slave servers. The slave servers send status updates to the server, and if the server hasn't heard from a specific slave in a fixed period, it marks the slave as down. This is…
dbeer
  • 6,963
  • 3
  • 31
  • 47
36
votes
2 answers

Is there a way to use errno safely in a multi-threaded application?

If you are writing a multi-threaded application that uses system/library calls that make use of errno to indicate the error type, is there a safe way to use errno? If not, is there some other way to indicate the type of error that occurred rather…
Erik Öjebo
  • 10,821
  • 4
  • 54
  • 75
35
votes
4 answers

Why return a negative errno? (e.g. return -EIO)

Another simple example: if (wpa_s->mlme.ssid_len == 0) return -EINVAL; Why the unary minus? Is this (usually) done for functions that return >0 on success and <(=)0 on failure, or is there some other reason?
exscape
  • 2,185
  • 4
  • 21
  • 25
1
2 3
37 38