6 Star 1 Fork 0

openEuler2020 / 7-湖上摸鱼家

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
uthread.h 1.66 KB
一键复制 编辑 原始数据 按行查看 历史
#ifndef UTHREAD_H
#define UTHREAD_H
#include <sys/types.h>
#include <sys/socket.h>
#include <stdint.h>
#include "timer.h"
struct uthread *ut;
int uthread_create(struct uthread **new_ut, void *func, void *arg);
ssize_t pthread_disk_read(int fd, void *buf, size_t nbytes);
ssize_t pthread_disk_write(int fd, void *buf, size_t nbytes);
int uthread_join(struct uthread *ut, void **retval);
unsigned long uthread_self(void);
void uthread_exit(void *retval);
int uthread_detach(struct uthread *ut);
// 开放给socket的接口
int uthread_socket(int domain, int type, int protocol);
int uthread_accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
int uthread_connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
ssize_t uthread_read(int fd, void *buf, size_t length);
ssize_t uthread_recv(int fd, void *buf, size_t length, int flags);
ssize_t uthread_recvmsg(int fd, struct msghdr *message, int flags);
ssize_t uthread_recvfrom(int fd, void *buf, size_t length, int flags, struct sockaddr *address, socklen_t *address_len);
ssize_t uthread_recv_exact(int fd, void *buf, size_t length, int flags) ;
ssize_t uthread_read_exact(int fd, void *buf, size_t length);
ssize_t uthread_write(int fd, const void *buf, size_t length);
ssize_t uthread_send(int fd, const void *buf, size_t length, int flags);
ssize_t uthread_sendmsg(int fd, const struct msghdr *message, int flags);
ssize_t uthread_sendto(int fd, const void *buf, size_t length, int flags, const struct sockaddr *dest_addr, socklen_t dest_len);
ssize_t uthread_writev(int fd, struct iovec *iov, int iovcnt);
int enable_hook();
void main_end();
// 下面的接口临时开放给用户
void _uthread_yield();
#endif
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openeuler2020/team-1800615318.git
git@gitee.com:openeuler2020/team-1800615318.git
openeuler2020
team-1800615318
7-湖上摸鱼家
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891