aboutsummaryrefslogtreecommitdiff
path: root/src/lib/libkogata/mainloop.c
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2016-07-16 15:59:46 +0200
committerAlex Auvolat <alex@adnab.me>2016-07-16 15:59:46 +0200
commit3d6a857b9186ef6304ea6cf04627c2b787169f29 (patch)
tree756179ce1e1838f75c57e3efec2a570d72051594 /src/lib/libkogata/mainloop.c
parent59000174aa50ed6b2d24a71576d15e6a53c5be0c (diff)
downloadkogata-3d6a857b9186ef6304ea6cf04627c2b787169f29.tar.gz
kogata-3d6a857b9186ef6304ea6cf04627c2b787169f29.zip
Make way for libc implementation
Diffstat (limited to 'src/lib/libkogata/mainloop.c')
-rw-r--r--src/lib/libkogata/mainloop.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libkogata/mainloop.c b/src/lib/libkogata/mainloop.c
index bce1174..c1758a4 100644
--- a/src/lib/libkogata/mainloop.c
+++ b/src/lib/libkogata/mainloop.c
@@ -91,7 +91,7 @@ void mainloop_run() {
// ---- Do the select
/*dbg_printf("(mainloop) begin select\n");*/
- bool ok = select(sel_arg, nfds, -1);
+ bool ok = sc_select(sel_arg, nfds, -1);
if (!ok) {
dbg_printf("(mainloop) Failed to select.\n");
free(sel_arg);
@@ -107,7 +107,7 @@ void mainloop_run() {
fd->on_error(fd);
} else if ((sel_arg[i].got_flags & SEL_READ) && fd->rd_buf != 0) {
fd->rd_buf_filled +=
- read(fd->fd, 0, fd->rd_buf_expect_size - fd->rd_buf_filled, fd->rd_buf + fd->rd_buf_filled);
+ sc_read(fd->fd, 0, fd->rd_buf_expect_size - fd->rd_buf_filled, fd->rd_buf + fd->rd_buf_filled);
if (fd->rd_buf_filled == fd->rd_buf_expect_size) {
/*dbg_printf("(mainloop) finish read %d\n", fd->rd_buf_expect_size);*/
fd->rd_buf_filled = 0;
@@ -118,7 +118,7 @@ void mainloop_run() {
size_t remain_size = fd->wr_bufs[0].size - fd->wr_bufs[0].written;
void* write_ptr = fd->wr_bufs[0].buf + fd->wr_bufs[0].written;
- fd->wr_bufs[0].written += write(fd->fd, 0, remain_size, write_ptr);
+ fd->wr_bufs[0].written += sc_write(fd->fd, 0, remain_size, write_ptr);
if (fd->wr_bufs[0].written == fd->wr_bufs[0].size) {
/*dbg_printf("(mainloop) finish write %d\n", fd->wr_bufs[0].size);*/