czemu write zwraca -1? /=Kod:#include <netinet/in.h> #include <netdb.h> #include <arpa/inet.h> #include <unistd.h> #include <sys/socket.h> int main(){ int s; char packet[]={ 0x00, 0x21, 0x29, 0x78, 0xd0, 0xfc, //mac_destination 0x00, 0x1e, 0x58, 0x47, 0x10, 0xe3, //mac_source 0x08, 0x00, //protocol = IP 0x45, //version + length 0x00, 0x00, 0x1c, 0x00, 0x00, 0x40, 0x00, 0x40, 0x01, 0xbd, 0x25, 0x01, 0x00, 0x00, 0x02, 0xd1, 0x55, 0xab, 0x64, 0x08, 0x00, 0xbb, 0xe3, 0x3c, 0x18, 0x00, 0x04 }; s = socket(PF_PACKET, SOCK_RAW, 0); perror(0); write(s, packet, sizeof(packet)); perror(0); close(s); return 0; }