mirror of https://github.com/F-Stack/f-stack.git
Fiexd some build errors ubuntu 22.04 (kernel:5.19.0-1025, gcc:11.4.0),
Ref #777.
This commit is contained in:
parent
8471eecb32
commit
0ee517ed0a
|
@ -90,8 +90,8 @@ libff_syscall.so: ${FF_SYSCALL_OBJS}
|
||||||
${CC} -fPIC -shared -o $@ $^ ${FF_SYSCALL_LIBS} ${DPDK_LIBS}
|
${CC} -fPIC -shared -o $@ $^ ${FF_SYSCALL_LIBS} ${DPDK_LIBS}
|
||||||
|
|
||||||
example:
|
example:
|
||||||
cc ${CFLAGS} -I ${FF_PATH}/adapter/syscall -L ${FF_PATH}/adapter/syscall -lff_syscall -o helloworld_stack main_stack.c ${LIBS}
|
cc ${CFLAGS} -I ${FF_PATH}/adapter/syscall -o helloworld_stack main_stack.c -L ${FF_PATH}/adapter/syscall -lff_syscall ${LIBS}
|
||||||
cc ${CFLAGS} -I ${FF_PATH}/adapter/syscall -L ${FF_PATH}/adapter/syscall -lff_syscall -o helloworld_stack_thread_socket main_stack_thread_socket.c ${LIBS}
|
cc ${CFLAGS} -I ${FF_PATH}/adapter/syscall -o helloworld_stack_thread_socket main_stack_thread_socket.c -L ${FF_PATH}/adapter/syscall -lff_syscall ${LIBS}
|
||||||
cc ${CFLAGS} -I ${FF_PATH}/adapter/syscall -o helloworld_stack_epoll main_stack_epoll.c ${LIBS}
|
cc ${CFLAGS} -I ${FF_PATH}/adapter/syscall -o helloworld_stack_epoll main_stack_epoll.c ${LIBS}
|
||||||
cc ${CFLAGS} -I ${FF_PATH}/adapter/syscall -o helloworld_stack_epoll_thread_socket main_stack_epoll_thread_socket.c ${LIBS}
|
cc ${CFLAGS} -I ${FF_PATH}/adapter/syscall -o helloworld_stack_epoll_thread_socket main_stack_epoll_thread_socket.c ${LIBS}
|
||||||
cc ${CFLAGS} -I ${FF_PATH}/adapter/syscall -o helloworld_stack_epoll_kernel main_stack_epoll_kernel.c ${LIBS}
|
cc ${CFLAGS} -I ${FF_PATH}/adapter/syscall -o helloworld_stack_epoll_kernel main_stack_epoll_kernel.c ${LIBS}
|
||||||
|
|
|
@ -116,7 +116,12 @@ void *loop(void *arg)
|
||||||
char buf[256];
|
char buf[256];
|
||||||
size_t readlen = read( events[i].data.fd, buf, sizeof(buf));
|
size_t readlen = read( events[i].data.fd, buf, sizeof(buf));
|
||||||
if(readlen > 0) {
|
if(readlen > 0) {
|
||||||
write( events[i].data.fd, html, sizeof(html) - 1);
|
ssize_t writelen = write( events[i].data.fd, html, sizeof(html) - 1);
|
||||||
|
if (writelen < 0){
|
||||||
|
printf("write failed, readlen:%lu, writelen:%lu, :%d, %s\n",
|
||||||
|
readlen, writelen, errno, strerror(errno));
|
||||||
|
close(events[i].data.fd);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
epoll_ctl(epfd, EPOLL_CTL_DEL, events[i].data.fd, NULL);
|
epoll_ctl(epfd, EPOLL_CTL_DEL, events[i].data.fd, NULL);
|
||||||
close(events[i].data.fd);
|
close(events[i].data.fd);
|
||||||
|
|
|
@ -122,7 +122,12 @@ void *loop(void *arg)
|
||||||
char buf[256];
|
char buf[256];
|
||||||
size_t readlen = read( events[i].data.fd, buf, sizeof(buf));
|
size_t readlen = read( events[i].data.fd, buf, sizeof(buf));
|
||||||
if(readlen > 0) {
|
if(readlen > 0) {
|
||||||
write( events[i].data.fd, html, sizeof(html) - 1);
|
size_t writelen = write( events[i].data.fd, html, sizeof(html) - 1);
|
||||||
|
if (writelen < 0){
|
||||||
|
printf("write failed, readlen:%lu, writelen:%lu, :%d, %s\n",
|
||||||
|
readlen, writelen, errno, strerror(errno));
|
||||||
|
close(events[i].data.fd);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
epoll_ctl(epfd, EPOLL_CTL_DEL, events[i].data.fd, NULL);
|
epoll_ctl(epfd, EPOLL_CTL_DEL, events[i].data.fd, NULL);
|
||||||
close(events[i].data.fd);
|
close(events[i].data.fd);
|
||||||
|
|
|
@ -184,7 +184,12 @@ void *loop(void *arg)
|
||||||
char buf[256];
|
char buf[256];
|
||||||
size_t readlen = read( events[i].data.fd, buf, sizeof(buf));
|
size_t readlen = read( events[i].data.fd, buf, sizeof(buf));
|
||||||
if(readlen > 0) {
|
if(readlen > 0) {
|
||||||
write( events[i].data.fd, html, sizeof(html) - 1);
|
size_t writelen = write( events[i].data.fd, html, sizeof(html) - 1);
|
||||||
|
if (writelen < 0){
|
||||||
|
printf("write failed, readlen:%lu, writelen:%lu, :%d, %s\n",
|
||||||
|
readlen, writelen, errno, strerror(errno));
|
||||||
|
close(events[i].data.fd);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
epoll_ctl(epfd, EPOLL_CTL_DEL, events[i].data.fd, NULL);
|
epoll_ctl(epfd, EPOLL_CTL_DEL, events[i].data.fd, NULL);
|
||||||
close(events[i].data.fd);
|
close(events[i].data.fd);
|
||||||
|
|
Loading…
Reference in New Issue