socket:: No such file or directory

Hello,

when I start an application by the pfm (double click), the statement

socket(AF_INET,SOCK_DGRAM,0);

returns -1 with the error number ENOENT → No such file or directory!

All works well if the application has been started from a shell command
line.

What’s the problem ?

–Armin

Armin Steinhoff <a-steinhoff@web.de> wrote:


Hello,

when I start an application by the pfm (double click), the statement

socket(AF_INET,SOCK_DGRAM,0);

returns -1 with the error number ENOENT → No such file or directory!

All works well if the application has been started from a shell command
line.

What’s the problem ?

–Armin

It works OK for me. Are you in a chrooted environment?
Is the stack running?

Regards,

-seanb

Sean Boudreau wrote:

Armin Steinhoff <> a-steinhoff@web.de> > wrote:



Hello,


when I start an application by the pfm (double click), the statement


socket(AF_INET,SOCK_DGRAM,0);


returns -1 with the error number ENOENT → No such file or directory!


All works well if the application has been started from a shell command
line.


What’s the problem ?


–Armin


It works OK for me. Are you in a chrooted environment?

I’m logged in as ‘root’

Is the stack running?

Yes, it works if the application is started by the
command ‘pterm dView &’

Best Regards

–Armin



Regards,

-seanb

Sean Boudreau wrote:

Armin Steinhoff <> a-steinhoff@web.de> > wrote:



Hello,


when I start an application by the pfm (double click), the statement


socket(AF_INET,SOCK_DGRAM,0);


returns -1 with the error number ENOENT → No such file or directory!

How ever … that returned error code isn’t a documented behavior.

What is the reason of such an error case??

Regards

–Armin

Sean Boudreau wrote:

Armin Steinhoff <> a-steinhoff@web.de> > wrote:



Hello,


when I start an application by the pfm (double click), the statement


socket(AF_INET,SOCK_DGRAM,0);


returns -1 with the error number ENOENT → No such file or directory!


All works well if the application has been started from a shell command
line.


What’s the problem ?


–Armin


It works OK for me. Are you in a chrooted environment?

just to answer that question correctly … a chroot call isn’t used by
the application.

–Armin

Armin Steinhoff <a-steinhoff@web.de> wrote:

Sean Boudreau wrote:
Armin Steinhoff <> a-steinhoff@web.de> > wrote:



Hello,


when I start an application by the pfm (double click), the statement


socket(AF_INET,SOCK_DGRAM,0);


returns -1 with the error number ENOENT → No such file or directory!

How ever … that returned error code isn’t a documented behavior.

What is the reason of such an error case??

‘Old’ versions of the library used to throw this if
/dev/socket/X (/dev/socket/2 in your case) wasn’t
present: usually if the stack wasn’t running. Later
versions throw EAFNOSUPPORT as per POSIX. The latter
isn’t doc’d either so I made a PR.

Can you post a test case?

Regards,

-seanb

Sean Boudreau <seanb@qnx.com> wrote:

Armin Steinhoff <> a-steinhoff@web.de> > wrote:
Sean Boudreau wrote:
Armin Steinhoff <> a-steinhoff@web.de> > wrote:



Hello,


when I start an application by the pfm (double click), the statement


socket(AF_INET,SOCK_DGRAM,0);


returns -1 with the error number ENOENT → No such file or directory!

How ever … that returned error code isn’t a documented behavior.

What is the reason of such an error case??

‘Old’ versions of the library used to throw this if
/dev/socket/X (/dev/socket/2 in your case) wasn’t
present: usually if the stack wasn’t running. Later
versions throw EAFNOSUPPORT as per POSIX. The latter
isn’t doc’d either so I made a PR.

Can you post a test case?

Another thought, do you have the SOCK environmental
variable set?

-seanb

Sean Boudreau wrote:

Sean Boudreau <> seanb@qnx.com> > wrote:

Armin Steinhoff <> a-steinhoff@web.de> > wrote:

Sean Boudreau wrote:

Armin Steinhoff <> a-steinhoff@web.de> > wrote:




[clip]
What is the reason of such an error case??


‘Old’ versions of the library used to throw this if
/dev/socket/X (/dev/socket/2 in your case) wasn’t
present: usually if the stack wasn’t running. Later
versions throw EAFNOSUPPORT as per POSIX. The latter
isn’t doc’d either so I made a PR.


Can you post a test case?

Ok … I will try to rebuild that problem by stripped down example.

Another thought, do you have the SOCK environmental
variable set?

The PC system has only one network interface (en0).

The SOCK env. variable is not set.

–Armin