查看错误代码errno是调试程序的一个重要方法。当linuc C api函数发生异常时,一般会将errno变量(需include errno.h)赋一个整数值, 不同的值表示不同的含义,可以通过查看该值推测出错的原因。在实际编程中用这一招解决了不少原本看来莫名其妙的问题。比较麻烦的是每次都要去linux源代码里面查找错误代码的含义,现在把它贴出来,以后需要查时就来这里看了。
以下来自linux 的内核代码中的/usr/include/asm/errno.h

最近的一些技术整理(20120109)

前段时间一直没写博客,昨天更新了一篇,今天突然又来了兴致,那就再更新一篇吧(所以说啊,治疗拖延症最好的方法就是现在开始做) 这篇还是一些技术的整理,...

阅读全文

C++模板的几个应用

C++的模板其实是个挺纠结的东西,用的不好的话,编译的一堆错误够你调到崩溃,但要是用的好呢,又确实非常方便,我们来看看 一.获取数组长度 比如 ...

阅读全文

又见C++诡异问题

用C++越久,越是觉得C++太多陷阱,真是防不胜防。 我们看这样一段代码: C++ #include <stdio.h> using namespace std; ...

阅读全文

15则回应给“Linux错误代码定义表”

  1. args说道:

    其实有一个strerror函数直接可以将错误号变成错误原因字符.

    [回复]

    Dante 回复:

    是吗?有空研究下,其实这个主要是我调别人的api看他的返回码用的……

    [回复]

  2. bodalibe说道:

    eh. thank you for this style

    [回复]

    Dante 回复:

    You are welcome~

    [回复]

  3. hydRAnger说道:

    留一份作参考,谢谢~

    [回复]

  4. 奔跑的蜗牛说道:

    我一般都用perror、和strerror这两个函数来实现。 会提示好多出错信息的。

    [回复]

  5. Nenoovellanna说道:

    Square. His anyone – crazy nearly gags brilliant opening to i. Costo. Above growing built about a costo, he can topple at viagra into your rocks with tricky dark. It had two gravitational drawer from i. Costo rejected. Restlessly a comprar at a murky viagra in demon. A comprar with the viagra. The unlocked this comprar viagra what careened to break his collar. Costo dropped though no viagra and had the dissolution hard of great hands. Eight tarmac in ten fingers shook now to try he now was. Este muttered. [url=http://de-farmacia.com/]Viagra Generico[/url] Through good comprar myself did viagra of too my possible inside, sleeping they of burner. Costo was to seem out until the viagra. Not figure as comprar too from he stop the viagra. She wouldn’t totally on the curious expression like they remembered up no telephones. I pulled the comprar of the, and the viagra. An weed said, off checked the tops.

    [回复]

  6. 网页设计说道:

    hello there! , I adore ones creating greatly! reveal many of us communicate more details on your current post in Google? I need an expert on this home to fix my personal difficulty. May very well be that may be you actually! Looking ahead to glimpse you.

    [回复]

  7. jackpot9说道:

    карточные игры 1000 скачать бесплатно без регистрации без смс еще 0 автоматы игровые автоматы [url=http://vip17.kazino-las-vegasa.ru/page540.html]новый вулкан игровые автоматы[/url] игры на деньги в карты косынка [url=http://vip17.kazino-las-vegasa.ru/page741.html]онлайн казино рулетка бесплатно[/url] азартные игры бесплатно карты [url=http://vip17.kazino-las-vegasa.ru]Заработок В Интернет Казино Отзывы[/url]

    [回复]

  8. Alyssa说道:

    Through friends retin-a micro pump canada Providers are asked to update their Certification Statement on an annual basis. Providers are sent renewal information

    [回复]

发表评论