首页 \ 问答 \ 当epoll_wait返回EPOLLERR时如何获得errno?(How to get errno when epoll_wait returns EPOLLERR?)

当epoll_wait返回EPOLLERR时如何获得errno?(How to get errno when epoll_wait returns EPOLLERR?)

有什么方法可以在EPOLLERR为特定的fd返回EPOLLERR时找出errno

是否有关于错误性质的更多信息?

编辑:

添加更多信息以避免歧义

epoll_wait等待多个文件描述符。 当你调用epoll_wait你会传递一个epoll_event结构数组:

struct epoll_event {
           uint32_t     events;    /* Epoll events */
           epoll_data_t data;      /* User data variable */
       };

epoll_data_t结构具有与用于epoll_ctl向epoll添加文件描述符一样的细节:

typedef union epoll_data {
           void    *ptr;
           int      fd;
           uint32_t u32;
           uint64_t u64;
       } epoll_data_t;

我正在寻找的是当epoll正在等待的某个文件描述符出现错误时发生的情况。

即: epoll_event.events & EPOLLERR == 1 - 是否有办法找到文件描述符上的错误的更多细节?


Is there a way to find out the errno when epoll_wait returns EPOLLERR for a particular fd?

Is there any further information about the nature of the error?

Edit:

Adding more information to prevent ambiguity

epoll_wait waits on a number of file descriptors. When you call epoll_wait you pass it an array of epoll_event structures:

struct epoll_event {
           uint32_t     events;    /* Epoll events */
           epoll_data_t data;      /* User data variable */
       };

The epoll_data_t structure has the same details as the one you used with epoll_ctl to add a file descriptor to epoll:

typedef union epoll_data {
           void    *ptr;
           int      fd;
           uint32_t u32;
           uint64_t u64;
       } epoll_data_t;

What I'm looking for is what happens when there is an error on one of the file descriptors that epoll is waiting on.

ie: (epoll_event.events & EPOLLERR) == 1 - is there a way to find out more details of the error on the file descriptor?


原文:https://stackoverflow.com/questions/13150377
更新时间:2023-08-15 08:08

最满意答案

词汇Schema.org(尚未)提供用于表示餐馆菜单或单个菜单项的类型。

他们的menu属性需要文本或URL作为值。 如果应该有菜单类型,它将成为另一个预期值。

问题扩展提案:FoodProducts的FoodProduct和餐厅菜单。 问这个。 它已关闭,引用更广泛的问题创建一个新的食物类型(进一步帮助foodWarning和recipeIngredient) 。 它仍在讨论中。

如果您现在需要某些东西,可以使用引用OfferCatalog类型hasOfferCatalog属性 (表示菜单或菜单的分组部分)和Offer类型 (表示单个菜单项,带有价格)。

例如:

<div vocab="http://schema.org/" typeof="Restaurant">
  <section property="hasOfferCatalog" typeof="OfferCatalog">
    <h1 property="name">Menu</h1>
    <ul>

      <li property="itemListElement" typeof="Offer">
        <b property="name">Bread</b> – 
        <span property="price">1.50</span>
        <meta property="priceCurrency" content="EUR" />
      </li>

      <li property="itemListElement" typeof="Offer">
        <b property="name">Water</b> – 
        <span property="price">1.00</span>
        <meta property="priceCurrency" content="EUR" />
      </li>

    </ul>
  </section>
</div>

如果您也想使用menu属性,可以添加一个包含OfferCatalogdivmenu的值将是文本内容。

<div vocab="http://schema.org/" typeof="Restaurant">
  <div property="menu">
    <section property="hasOfferCatalog" typeof="OfferCatalog">
      <!-- … -->
    </section>
  </div>
</div>

The vocabulary Schema.org does not (yet) offer a type for representing restaurant menus or single menu items.

Their menu property expects text or URL as value. If there should ever be a type for menus, it would become another expected value.

The issue Extension Proposal: FoodProduct and Restaurant Menu with FoodProducts. asked for this. It got closed, referencing the broader issue Create a new Food type (help further with foodWarning and recipeIngredient). It’s still under discussion.

If you need something now, you could use the hasOfferCatalog property that references an OfferCatalog type (representing the menu, or grouped parts of the menu) and the Offer type (representing a single menu item, with a price).

For example:

<div vocab="http://schema.org/" typeof="Restaurant">
  <section property="hasOfferCatalog" typeof="OfferCatalog">
    <h1 property="name">Menu</h1>
    <ul>

      <li property="itemListElement" typeof="Offer">
        <b property="name">Bread</b> – 
        <span property="price">1.50</span>
        <meta property="priceCurrency" content="EUR" />
      </li>

      <li property="itemListElement" typeof="Offer">
        <b property="name">Water</b> – 
        <span property="price">1.00</span>
        <meta property="priceCurrency" content="EUR" />
      </li>

    </ul>
  </section>
</div>

If you want to use the menu property, too, you could add a div that encloses the OfferCatalog. The value for menu would then be the textual content.

<div vocab="http://schema.org/" typeof="Restaurant">
  <div property="menu">
    <section property="hasOfferCatalog" typeof="OfferCatalog">
      <!-- … -->
    </section>
  </div>
</div>

相关问答

更多
  • 词汇Schema.org(尚未)提供用于表示餐馆菜单或单个菜单项的类型。 他们的menu属性需要文本或URL作为值。 如果应该有菜单类型,它将成为另一个预期值。 问题扩展提案:FoodProducts的FoodProduct和餐厅菜单。 问这个。 它已关闭,引用更广泛的问题创建一个新的食物类型(进一步帮助foodWarning和recipeIngredient) 。 它仍在讨论中。 如果您现在需要某些东西,可以使用引用OfferCatalog类型的hasOfferCatalog属性 (表示菜单或菜单的分组部 ...
  • 我会说Map对于Hotel项目来说并不是真正有用的“父”类型,这对于Schema.org来说是不可能的,因为Map没有定义可以引用Place包含的项目的属性。 最基本的结构是Place项(页面的主要主题)和与containsPlace属性关联的几个Hotel项。 另外指定了Map 。
    使用模块CCK和视图模块。 如果你还没有听说过这些模块,那么你应该去http://drupalmodules.com这样的网站(比搜索drupal更好的方式)和研究模块。 一旦你安装了这些模块,创建一个名为“Menu Item”的内容类型。 为内容键入以下字段: 项目名 商品描述 价钱 菜单类别(开胃菜,主菜等) 图片(可选) 然后,使用视图渲染项目的方式。 可能使用表格或网格布局。 你应该对每个类别(开胃菜一个,主菜一个等)进行观察。 对于每个类别的视图: 确保添加“块”显示。 确保您选择按“发布”进行过 ...
  • 我认为你是对的:使用isPartOf来指示页面或文件(播放器)所属的父集合(在本例中为团队)。 所以在播放器的页面上: Member of the Toronto Maple Leafs 在团队页面上,确保它标有CollectionPage,例如: I think you're ...
  • [请注意,您正在链接到schema:URL (这是一个数据类型),而不是schema:url (这是您的问题似乎涉及的属性)。 Schema.org URI区分大小写。] 对于作者而言:将url想象成你想要使用的URL(通常来自你自己的网站),并且与其他人使用的URL(通常来自外部网站)一样,通常是sameAs的。 对于消费者来说:使用url输出链接以及从作者的角度查找关于同一项目的更多数据(例如,在预告片页面上的链接到整篇文章页面),以及使用sameAs for更好地理解作者在他们的项目中描述的内容。 例 ...
  • 我遇到了部门规范,我认为这是我应该在同一组织的多个地点进行标记的方式;