MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / serial_fops_ioctl

Function serial_fops_ioctl

components/drivers/serial/dev_serial_v2.c:117–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117static int serial_fops_ioctl(struct dfs_file *fd, int cmd, void *args)
118{
119 rt_device_t device;
120 int flags = (int)(rt_base_t)args;
121 int mask = O_NONBLOCK | O_APPEND;
122
123 device = (rt_device_t)fd->vnode->data;
124 switch ((rt_ubase_t)cmd)
125 {
126 case FIONREAD:
127 break;
128 case FIONWRITE:
129 break;
130 case F_SETFL:
131 flags &= mask;
132 fd->flags &= ~mask;
133 fd->flags |= flags;
134 break;
135 default:
136 break;
137 }
138
139 return rt_device_control(device, cmd, args);
140}
141
142#ifdef RT_USING_DFS_V2
143static ssize_t serial_fops_read(struct dfs_file *fd, void *buf, size_t count, off_t *pos)

Callers

nothing calls this directly

Calls 1

rt_device_controlFunction · 0.85

Tested by

no test coverage detected