Files
mars-libowfat/buffer/buffer_stubborn2.c
leitner b7b8a0efc1 gcc 15 and C23 force some union trickery on buffer.h :-(
add a few buffer_init*_forread variants to pretend we have type safety
  make sure buffer_init_staticcontents handles flushing attempts
2025-04-22 09:32:03 +00:00

14 lines
299 B
C

#include <errno.h>
#include "buffer.h"
ssize_t buffer_stubborn_read(ssize_t (*op)(int fd,char* buf,size_t len,void* cookie),int fd,char* buf, size_t len,void* cookie) {
ssize_t w;
for (;;) {
if ((w=op(fd,buf,len,cookie))<0)
if (errno == EINTR) continue;
break;
}
return w;
}