32 lines · 430 B · C
RawDownload
#include <u.h>#include <libc.h> intpostnote(int group, int pid, char *note){	char file[128];	int f, r; 	switch(group) {	case PNPROC:		sprint(file, "/proc/%d/note", pid);		break;	case PNGROUP:		sprint(file, "/proc/%d/notepg", pid);		break;	default:		return -1;	} 	f = open(file, OWRITE);	if(f < 0)		return -1; 	r = strlen(note);	if(write(f, note, r) != r) {		close(f);		return -1;	}	close(f);	return 0;}

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