php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #7576 socket() always fails with an "Unknown error"
Submitted: 2000-11-01 18:07 UTC Modified: 2001-06-27 00:02 UTC
From: mitch at venux dot net Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.0.3pl1 OS: FreeBSD 4 / Linux Kernel 2.2.16
Private report: No CVE-ID: None
 [2000-11-01 18:07 UTC] mitch at venux dot net
Something like

if ( ($iSockFD = socket (AF_INET, SOCK_STREAM,0) ) != 0) {
	print "Call to socket() failed: reason: " . strerror ($iSockFD) . "\n";
	exit();
}

That results in an "Unknown error 4294967293" message from strerror() in Linux kernel 2.2.16.. A "Unknown error: -3" in FreeBSD 4.0  -- no matter what user I am, this error occurs on both operating systems.. 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-01 18:51 UTC] chrisv@php.net
Read your local man page on socket(2). Most of the functions in the sockets extension return >= 0 on success and < 0 on error.

Reclassified as a documentation problem.

Docs writers: feel free to bug me on the semantics of the functions in the module and such :)
 [2001-06-27 00:02 UTC] danbeck@php.net
This behaviour has already been documented, including the reference to the socket(2) man page.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 04 21:01:32 2024 UTC