Benjamin Scher Purcelladding auth nowd7e4e2911 years agoHistory
33 lines · 448 B · C
RawDownload
#include <sys/types.h> #include <stdint.h> #include "../libc.h"#include "../fcall.h" intread9pmsg(int fd, void *abuf, uint n){	int m, len;	uchar *buf; 	buf = abuf; 	/* read count */	m = readn(fd, buf, BIT32SZ);	if(m != BIT32SZ){		if(m < 0)			return -1;		return 0;	} 	len = GBIT32(buf);	if(len <= BIT32SZ || len > n){		return -1;	}	len -= BIT32SZ;	m = readn(fd, buf+BIT32SZ, len);	if(m < len)		return 0;	return BIT32SZ+m;}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t