为什麽u_open()执行会出错
我有一段这样的程序,
#define FIFO_PATH "/tmp/.asppp.fifo"
STATUS solaris_ppp_init
(
int ppp_fd
)
{
char buf[256];
char name[64]; /* user name string */
struct strbuf data;
register int fd; /* FIFO to aspppd */
union fifo_msgs *fifo_msg;
int retries;
/*
* Simple protocol, send:
*
* user name and trailing null
* file descriptor (could be stdin or stdout) that remote end
* connected on
*/
sprintf(name, "vxsim%d", sysProcNumGet());
/*
* sometimes we need to let asppd clean up a previous connection
* so retry the open a few times
*/
for (retries=0, fd=-1; retries < 4 && fd < 0; retries++)
if ((fd = u_open(FIFO_PATH, O_WRONLY, 0)) < 0)
u_sleep(1);
if (fd < 0)
{
u_printf("Can't open %s\n", FIFO_PATH);
return(ERROR);
}
#if FALSE
/* set a high debug level in the Solaris PPP driver */
data.buf = buf;
data.len = sizeof (debug_t);
data.maxlen = sizeof (debug_t);
fifo_msg = (union fifo_msgs *)data.buf;
fifo_msg->;msg = FIFO_DEBUG;
fifo_msg->;debug.debug_level = 42;
if (u_putmsg (fd, NULL, &data, 0) < 0)
{
u_printf("Can't send name to aspppd\n"
u_close(fd);
return(ERROR);
}
#endif
data.buf = buf;
data.len = sizeof (uname_t);
fifo_msg = (union fifo_msgs *)data.buf;
fifo_msg->;msg = FIFO_UNAME;
strcpy(fifo_msg->;uname.uname, name);
if (u_putmsg (fd, NULL, &data, 0) < 0)
{
u_printf("Can't send name to aspppd\n"
u_close(fd);
return(ERROR);
}
if (u_ioctl(fd, I_SENDFD, (void *)ppp_fd) < 0)
{
u_printf("Can't send local fd to aspppd\n"
u_close(fd);
return(ERROR);
}
return(OK);
}
在一个纯英文的Solaris8系统上没有问题,但是在一个安装了中文Solaris8的系统上(在CDE登陆时已经选择为英文环境),但是会打印Can't open /tmp/.asppp.fifo,u_open()函数的使用还会与什麽系统设置有关?
谢谢!!!!
...全文
相关推荐
U盘启动盘进入PE后如何重装系统?.docx
首先,我们需要了解为什么需要在PE系统中重装系统,然后我们需要了解如何使用GHOST工具来安装系统。最后,我们需要掌握手动ghost的方式,以避免计算机出错。
mysql错误can't open file
:mysql –h 主机地址 –u 用户名 –p,然后输入密码,连接数据库;Use 数据库名称;然后 输入:reapair table 出错的表名称,回车,这样修复一下就可以了。
Libpcap库主要函数说明
* ebuf 参数则仅在 pcap_open_offline()函数出错返回 NULL 时用于传递错误消息。
TMS320F2812 通过ch375对u盘文件操作
这部分代码示例如下: ```c UINT16 mCH375Init() { UINT16 i, j; CH375_CMD_PORT_d_out(CMD_GET_IC_VER); /* 获取芯片及固件版本
mfc80u.lib
通过理解和有效地使用MFC,开发者可以提高代码的可读性和可维护性,同时减少对Windows API的直接调用,降低出错的可能性。


其他技术讨论专区
