ChinaUnix.net
相关文章推荐:

atomic_read

我写了个 module,挂在 NF_IP_PRE_ROUTING 上,很简单的功能 [code] static unsigned int br_prerouting(unsigned int hooknum,struct sk_buff **skb, const struct net_device *in, const struct net_device *out, int (*okfn)(struct sk_buff *)) { struct iphdr *iph; struct icmphdr *icmph; if (!skb_make_w...

by platinum - 内核/嵌入技术 - 2006-04-14 16:07:45 阅读(2221) 回复(7)

相关讨论

int n = read(fd, buf, len), 当fd为一socket descriptor时,read在哪几种情况下会返回?

by TomTang - C/C++ - 2006-08-21 23:09:11 阅读(906) 回复(2)

#!/bin/sh sleep 3 echo "input a:" read a if [ "$a" == y ]; then echo $a else echo no fi 问题: 如果在shell sleep 的过程敲很多次回车 例如3次 现象为 [root@localhost]#./filename input a: no [root@localhost]# [root@localhost]# [root@localhost]# _ 也就是说shell记住了你敲的这3次回车 怎么能达到这种效果: 不管敲几次回车 只捕捉input a: 出现后的那一次输入 [root@localhost]#./filename i...

by lovec - Shell - 2006-05-17 17:24:49 阅读(1888) 回复(12)

请问“read"在shell scripts上是不是表示从标准输入上读出字符?

by x518889 - Linux论坛 - 2004-04-16 13:48:15 阅读(588) 回复(1)

typedef struct { volatile int counter; } atomic_t; 据说对这个atomic_t类型的操作都是原子的.原因是在对这种类型的操作之前都有lock语句.可是在程序中并没有发现lock,想问下程序在看到atomic_t类型时,是如何得知就要对它实现原子操作.

by 怪怪虎 - C/C++ - 2008-11-26 17:48:47 阅读(6588) 回复(7)

怎么能找到使用这个函数需要的头文件? 用man查不到。。。 顺便问一下,使用man都需要装些什么?我这里好像有很多函数都查不到 谢谢!

by NKLoveRene - C/C++ - 2014-03-31 22:25:07 阅读(5686) 回复(7)

请问在linux/unix中, atomic操作的含义 比如: 在多cpu环境的情况下 两个进程p1,p2同时分别在两个cpu下运行,执行把主存的一个值A(初始值为0)加1,并返回原值的操作.他们是atomic操作 ,其结果是什么

by wy1981105 - Linux论坛 - 2005-08-13 11:27:42 阅读(1084) 回复(9)

嵌入式Linux平台下的GPS数据采集涉及到Linux串口编程技术,从串口读取GPS信息需要用到read函数, read函数的定义如下: ssize_t read(int filedes, void *buf, size_t nbytes); 我想问两个问题: 1、这里的参数buf是什么类型的?是char型的吗? 2、当从串口接收到信息并保存到buf中时,我想看buf中保存的信息的第一个字符是不是%,请问 可不可以用if(buf[0]=='%')进行判断?

by 望秦淮 - C/C++ - 2009-05-05 17:55:46 阅读(1345) 回复(4)

echo 1 2 3 |while read a b c do i=5 done echo $i $i的值为啥不能被引用了

by Tim-Wang - Shell - 2009-05-05 17:17:33 阅读(4514) 回复(19)

TMLIMIT=4 read -t $TMLIMIT variable echo if [ -z "$variable" ]; then echo "Timed out, variable still unset." else echo "variable=$variable" fi exit 0 红色部分的一行是什么意思,请高手赐教。

by xyx219 - Shell - 2009-02-17 17:24:29 阅读(1239) 回复(5)

我要将一些输出的结果赋给变量,这样操作为什么不能实现呢? vmstat 3 2|sed 1,3d|awk '{printf("%s %s %s\n",$1,$7,$8)}'|while read A B C ...... 如何才能实现将结果赋给ABC呢? 谢谢~!

by leo_pro - Shell - 2007-06-25 14:45:20 阅读(1355) 回复(9)