LINUX 错误代码 errno
下面这个例子列出了所有系统定义的错误代码及错误描述
源代码是:
/************关于本文档********************************************
*filename: strerror.c
*purpose: 列出了系统定义的所有错误代码及描述
*wrote by: zhoulifa(zhoulifa@163.com) 周立发(http://zhoulifa.bokee.com)
Linux爱好者 Linux知识传播者 SOHO族 开发者 最擅长C语言
*date time:2008-01-26 21:03 上海大雪天,据说是多年不遇
*Note: 任何人可以任意复制代码并运用这些文档,当然包括你的商业用途
* 但请遵循GPL
*Thanks to:
* Ubuntu 本程序在Ubuntu 7.10系统上测试完全正常
* Google.com 我通常通过google搜索发现许多有用的资料
*Hope:希望越来越多的人贡献自己的力量,为科学技术发展出力
* 科技站在巨人的肩膀上进步更快!感谢有开源前辈的贡献!
*********************************************************************/
#include <string.h> /* for strerror */
#include <errno.h>
#include <stdio.h>
int main(int argc, char ** argv) {
int i = 0;
for(i = 0; i < 256; i++)
printf("errno.%02d is: %s\n", i, strerror(i));
return 0;
}
编译此程序用命令:
gcc -Wall strerror.c
执行程序:
./a.out
输出如下:
errno.00 is: Success
errno.01 is: Operation not permitted
errno.02 is: No such file or directory
errno.03 is: No such process
errno.04 is: Interrupted system call
errno.05 is: Input/output error
errno.06 is: No such device or address
errno.07 is: Argument list too long
errno.08 is: Exec format error
errno.09 is: Bad file descriptor
errno.10 is: No child processes
errno.11 is: Resource temporarily unavailable
errno.12 is: Cannot allocate memory
errno.13 is: Permission denied
errno.14 is: Bad address
errno.15 is: Block device required
errno.16 is: Device or resource busy
errno.17 is: File exists
errno.18 is: Invalid cross-device link
errno.19 is: No such device
errno.20 is: Not a
相关文档:
第一种方法:
root用户登录系统
usr/local/mysql/bin/mysqladmin -u root -p password 新密码
enter password 旧密码
第二种方法:
root用户登录mysql数据库
mysql> update mysql.user set password=password("新密码")where User="root";
mysql> flush privileges;
mysql> quit ;
mysql忘记root密码如何 ......
在LINUX环境开发驱动程序,首先要探测到新硬件,接下来就是开发驱动程序。
常用命令整理如下:
用硬件检测程序kudzu探测新硬件:service kudzu start ( or restart)
查看CPU信息:cat /proc/cpuinfo
查看板卡信息:cat /proc/pci
查看PCI信息:lspci (相比cat /proc/pci更直观)
查看内存信息 ......
首先,服务器GCC要有,不然什么都不能做.能够用gcc -v来查看是否安装了GCC,
#gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
--enable-shared --enable-threads=posix --disable-checki ......
目录结构为:
inc/hello.h
src/hello.c
main/main.c
Makefile
文件内容为:
hello.h:
void hello(char name[]);
hello.c:
#include <stdio.h>
void hello(char name[])
{
printf("Hello %s!\n", name);
}
main.c:
#include <stdio.h>
#include "hello.h"
// The second hello.h should ......
本文主要内容是介绍ODBC的简单原理,以及如何在Linux/Unix下进行ODBC的安装、配置与编程。
ODBC原理
ODBC
是Open Database Connect 即开放数据库互连的简称,它是由Microsoft 公司于1991
年提出的一个用于访问数据库的统一界面标准,是应用程序和数据库系统之间的中间件。它通过使用相应应用平台上和所需数据库对应的驱 ......