91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 10.14MB
    文件類型: .gz
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2023-10-08
  • 語言: 其他
  • 標(biāo)簽: QNX??源碼??

資源簡介

QNX6源碼不再開源,系統(tǒng)的資料相當(dāng)少,要弄清系統(tǒng)結(jié)構(gòu),必須分析源代碼,本代碼是低版本的,但不影響原理的分析學(xué)習(xí)。

資源截圖

代碼片段和文件信息

/*
?*?$QNXLicenseC:
?*?Copyright?2007?QNX?Software?Systems.?All?Rights?Reserved.
?*?
?*?You?must?obtain?a?written?license?from?and?pay?applicable?license?fees?to?QNX?
?*?Software?Systems?before?you?may?reproduce?modify?or?distribute?this?software?
?*?or?any?work?that?includes?all?or?part?of?this?software.???Free?development?
?*?licenses?are?available?for?evaluation?and?non-commercial?purposes.??For?more?
?*?information?visit?http://licensing.qnx.com?or?email?licensing@qnx.com.
?*??
?*?This?file?may?contain?contributions?from?others.??Please?review?this?entire?
?*?file?for?other?proprietary?rights?or?license?notices?as?well?as?the?QNX?
?*?Development?Suite?License?Guide?at?http://licensing.qnx.com/license-guide/?
?*?for?other?information.
?*?$
?*/




#include?
#include?
#include?“asyncmsg_priv.h“

/*?This?is?painful.?We?have?to?prepare?receive?buf?and?associate
?*?it?with?the?chid?so?we?will?know?where?to?receive
?*/
int?asyncmsg_channel_create(unsigned?flags??mode_t?mode?size_t?buffer_size?unsigned?max_num_buffer?const?struct?sigevent?*ev?int?(*recvbuf_callback)(size_t?bufsize?unsigned?num_bufs?void*bufs[]?int?flags))
{
struct?_asyncmsg_channel_context?*acc;
int?chid;

if?((acc?=?(struct?_asyncmsg_channel_context?*)malloc(sizeof(*acc)))?==?NULL)?{
return?-1;
}
memset(acc?0?sizeof(*acc));

if?((errno?=?pthread_mutex_init(&acc->mutex?0))?!=?EOK)?{
free(acc);
return?-1;
}

acc->recvbuf_cb?=?recvbuf_callback;
acc->max_num_buffer?=?max_num_buffer;
acc->buffer_size?=?buffer_size;

if?((acc->iovs?=?malloc(sizeof(iov_t)?*?max_num_buffer))?==?NULL)?{
free(acc);
return?-1;
}

if?((chid?=?ChannelCreateExt(flags?|?_NTO_CHF_ASYNC?mode?buffer_size?max_num_buffer?ev?NULL))?==?-1)?{
pthread_mutex_destroy(&acc->mutex);
free(acc->iovs);
free(acc);
return?-1;
}

if?(_asyncmsg_handle(chid?_ASYNCMSG_HANDLE_ADD?|?_ASYNCMSG_HANDLE_CHANNEL?acc)?==?NULL)?{
asyncmsg_channel_destroy(chid);
free(acc->iovs);
free(acc);
return?-1;
}

return?chid;
}

__SRCVERSION(“asyncmsg_channel_create.c?$Rev:?153052?$“);

評論

共有 條評論