1--TEST-- 2ext/sockets - socket_strerror - basic test 3--CREDITS-- 4Florian Anderiasch 5fa@php.net 6--SKIPIF-- 7<?php 8 if (!extension_loaded('sockets') || !function_exists('socket_strerror')) { 9 die('skip sockets extension not available.'); 10 } 11 if (!stristr(PHP_OS, "Linux")) { 12 die('skip - test validates linux error strings only.'); 13 } 14?> 15--FILE-- 16<?php 17 $s_s = socket_strerror(); 18 for ($i=0;$i<=132;$i++) { 19 var_dump(socket_strerror($i)); 20 } 21?> 22--EXPECTF-- 23 24Warning: socket_strerror() expects exactly 1 parameter, 0 given in %s on line %i 25string(7) "Success" 26string(23) "Operation not permitted" 27string(25) "No such file or directory" 28string(15) "No such process" 29string(23) "Interrupted system call" 30string(18) "Input/output error" 31string(25) "No such device or address" 32string(22) "Argument list too long" 33string(17) "Exec format error" 34string(19) "Bad file descriptor" 35string(18) "No child processes" 36string(32) "Resource temporarily unavailable" 37string(22) "Cannot allocate memory" 38string(17) "Permission denied" 39string(11) "Bad address" 40string(21) "Block device required" 41string(23) "Device or resource busy" 42string(11) "File exists" 43string(25) "Invalid cross-device link" 44string(14) "No such device" 45string(15) "Not a directory" 46string(14) "Is a directory" 47string(16) "Invalid argument" 48string(29) "Too many open files in system" 49string(19) "Too many open files" 50string(30) "Inappropriate ioctl for device" 51string(14) "Text file busy" 52string(14) "File too large" 53string(23) "No space left on device" 54string(12) "Illegal seek" 55string(21) "Read-only file system" 56string(14) "Too many links" 57string(11) "Broken pipe" 58string(32) "Numerical argument out of domain" 59string(29) "Numerical result out of range" 60string(25) "Resource deadlock avoided" 61string(18) "File name too long" 62string(18) "No locks available" 63string(24) "Function not implemented" 64string(19) "Directory not empty" 65string(33) "Too many levels of symbolic links" 66string(16) "Unknown error 41" 67string(26) "No message of desired type" 68string(18) "Identifier removed" 69string(27) "Channel number out of range" 70string(24) "Level 2 not synchronized" 71string(14) "Level 3 halted" 72string(13) "Level 3 reset" 73string(24) "Link number out of range" 74string(28) "Protocol driver not attached" 75string(26) "No CSI structure available" 76string(14) "Level 2 halted" 77string(16) "Invalid exchange" 78string(26) "Invalid request descriptor" 79string(13) "Exchange full" 80string(8) "No anode" 81string(20) "Invalid request code" 82string(12) "Invalid slot" 83string(16) "Unknown error 58" 84string(20) "Bad font file format" 85string(19) "Device not a stream" 86string(17) "No data available" 87string(13) "Timer expired" 88string(24) "Out of streams resources" 89string(29) "Machine is not on the network" 90string(21) "Package not installed" 91string(16) "Object is remote" 92string(21) "Link has been severed" 93string(15) "Advertise error" 94string(13) "Srmount error" 95string(27) "Communication error on send" 96string(14) "Protocol error" 97string(18) "Multihop attempted" 98string(18) "RFS specific error" 99string(11) "Bad message" 100string(37) "Value too large for defined data type" 101string(26) "Name not unique on network" 102string(28) "File descriptor in bad state" 103string(22) "Remote address changed" 104string(38) "Can not access a needed shared library" 105string(36) "Accessing a corrupted shared library" 106string(31) ".lib section in a.out corrupted" 107string(47) "Attempting to link in too many shared libraries" 108string(37) "Cannot exec a shared library directly" 109string(49) "Invalid or incomplete multibyte or wide character" 110string(43) "Interrupted system call should be restarted" 111string(18) "Streams pipe error" 112string(14) "Too many users" 113string(30) "Socket operation on non-socket" 114string(28) "Destination address required" 115string(16) "Message too long" 116string(30) "Protocol wrong type for socket" 117string(22) "Protocol not available" 118string(22) "Protocol not supported" 119string(25) "Socket type not supported" 120string(23) "Operation not supported" 121string(29) "Protocol family not supported" 122string(40) "Address family not supported by protocol" 123string(22) "Address already in use" 124string(31) "Cannot assign requested address" 125string(15) "Network is down" 126string(22) "Network is unreachable" 127string(35) "Network dropped connection on reset" 128string(32) "Software caused connection abort" 129string(24) "Connection reset by peer" 130string(25) "No buffer space available" 131string(39) "Transport endpoint is already connected" 132string(35) "Transport endpoint is not connected" 133string(45) "Cannot send after transport endpoint shutdown" 134string(34) "Too many references: cannot splice" 135string(20) "Connection timed out" 136string(18) "Connection refused" 137string(12) "Host is down" 138string(16) "No route to host" 139string(29) "Operation already in progress" 140string(25) "Operation now in progress" 141string(%d) "Stale%sfile handle" 142string(24) "Structure needs cleaning" 143string(27) "Not a XENIX named type file" 144string(29) "No XENIX semaphores available" 145string(20) "Is a named type file" 146string(16) "Remote I/O error" 147string(19) "Disk quota exceeded" 148string(15) "No medium found" 149string(17) "Wrong medium type" 150string(18) "Operation canceled" 151string(26) "Required key not available" 152string(15) "Key has expired" 153string(20) "Key has been revoked" 154string(27) "Key was rejected by service" 155string(10) "Owner died" 156string(21) "State not recoverable" 157string(%d) "%s" 158