va_start(al,fmt); s= m_vasprintf(fmt,al); va_end(al);
return s;
}
+
+void *xmalloc(size_t sz) {
+ void *r= malloc(sz);
+ if (!r) common_diee("malloc");
+ return r;
+}
+
+void nonblock(int fd) {
+ int r;
+ r= fcntl(fd,F_GETFL); if (r<0) common_diee("nonblock fcntl F_GETFL");
+ r |= O_NONBLOCK;
+ r= fcntl(fd,F_SETFL,r); if (r<0) common_diee("nonblock fcntl F_GETFL");
+}