由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Linux版 - shall i call system("ifconfig eth0 ... up") or write my own (转载)
相关主题
CentOS (Linux)开机时不插网线的问题Re: 有没有什么网络函数能够 (转载)
move cable from eth1 to eth0, but cannot ping eth0请问怎么获取pptp拨号后的子网?
RHEL5救命:网路不通won't take the eth0 config from /etc/network/interaces
求教网卡设置问题unplug the network cable, ifconfig still says up
求助:ubuntu9.04 无线wpa上网失败VM中routing table消失的问题
求助:ubuntu上不了网(非无线)能否建立一个虚拟网卡并监听端口?
How to change pc wireless mac address under Ubuntu system?求助: How to add Trusted Devices in Firewall on RedHat 5 (or Centos 5)?
Linux下什么命令能知道哪个网卡插了线了?dumped ubuntu, now centos 6.4
相关话题的讨论汇总
话题: ifconfig话题: eth0话题: system话题: write话题: up
进入Linux版参与讨论
1 (共1页)
w*s
发帖数: 7227
1
【 以下文字转载自 Programming 讨论区 】
发信人: wds (净洗前尘,从头再来), 信区: Programming
标 题: shall i call system("ifconfig eth0 ... up") or write my own code ?
发信站: BBS 未名空间站 (Sun Oct 14 11:20:17 2012, 美东)
for a complicated linux application,
we need to configure ethernet port a lot,
e.g. bring up the port, for 2 ways,
1. system("ifconfig eth0 ... up")
2. write a c function
which way is better ? any concerns for method 1 ?
a9
发帖数: 21638
2
有些发行版已经不带ifconfig了,比如arch

【在 w*s 的大作中提到】
: 【 以下文字转载自 Programming 讨论区 】
: 发信人: wds (净洗前尘,从头再来), 信区: Programming
: 标 题: shall i call system("ifconfig eth0 ... up") or write my own code ?
: 发信站: BBS 未名空间站 (Sun Oct 14 11:20:17 2012, 美东)
: for a complicated linux application,
: we need to configure ethernet port a lot,
: e.g. bring up the port, for 2 ways,
: 1. system("ifconfig eth0 ... up")
: 2. write a c function
: which way is better ? any concerns for method 1 ?

b**r
发帖数: 352
3
system() usually is a quick and dirty way of doing stuff.
1. it's much slower than using system calls directly.
2. difficult to know if execution was done just as the way intended.
w*s
发帖数: 7227
4
这些发行版是linux的叛徒 !!!

【在 a9 的大作中提到】
: 有些发行版已经不带ifconfig了,比如arch
d********g
发帖数: 10550
5
这些万年不更新的package才是叛徒。没有ifconfig还有ip这个命令可用
RHEL/CentOS之流才是Linux界的耻辱

【在 w*s 的大作中提到】
: 这些发行版是linux的叛徒 !!!
n******t
发帖数: 4406
6
I agree changing default command is totally stupid.
But generally you do not want to invoking shell command in your
c code, unless it is quick and dirty solution.

【在 w*s 的大作中提到】
: 这些发行版是linux的叛徒 !!!
1 (共1页)
进入Linux版参与讨论
相关主题
dumped ubuntu, now centos 6.4求助:ubuntu9.04 无线wpa上网失败
installed CentOS 6.4, bootup, no network, no GUI求助:ubuntu上不了网(非无线)
Mysql无法远程连接,求助 (转载)How to change pc wireless mac address under Ubuntu system?
CentOS 5.3 怎么还不出来?Linux下什么命令能知道哪个网卡插了线了?
CentOS (Linux)开机时不插网线的问题Re: 有没有什么网络函数能够 (转载)
move cable from eth1 to eth0, but cannot ping eth0请问怎么获取pptp拨号后的子网?
RHEL5救命:网路不通won't take the eth0 config from /etc/network/interaces
求教网卡设置问题unplug the network cable, ifconfig still says up
相关话题的讨论汇总
话题: ifconfig话题: eth0话题: system话题: write话题: up