mac kernel and user space communication

rm_eo 在 Linux、UNIX下居然不同,不解

涩兔子 posted @ 2009年9月02日 16:51 in 未分类 , 6111 阅读

man regex中有Byte Offsets这样的一段,介绍遍历满足正则表达式条件的所有子串的rm_so(起始位置)和rm_eo(终止位置);

用到了regmatch_t结构:

typedef struct {
    regoff_t rm_so;
    regoff_t rm_eo;
} regmatch_t;
有这样的字符串"xzhai=\"Unix/Linux geek\";legendren=\"GOD\";"

想寻找="xxx";里的xxx内容;

 

while (!regexec(&m_reg, tmp, 1, &m_match, 0)) 
{
    // FIXME: Unix regex`s rm_eo is often 0 test under Mac OS X Leopard;
    // But Linux POSIX regex`s rm_eo is normal test under Gentoo Linux
    printf("%d - %d\n", m_match.rm_so, m_match.rm_eo);
    tmp += m_match.rm_eo;
}

Linux下rm_eo的值是正确的,而UNIX下rm_eo始终为0,不解

 

  • 无匹配
Avatar_small
zhz44 说:
2009年9月05日 16:18

其实不奇怪的阿,linux下有些函数的实现是和unix不一样的. mac os x的实现可能更接近于FreeBSD一些吧.

Avatar_small
babysitting services 说:
2019年9月15日 16:12

In other words, we have programs for some sort of safe as well as a hygienic setting. We hire deep clean-up methods in addition to innovative clean-up machines and cleaners for clean-up your developing internally intended for extending it is lifespan together with external developing cleaning to reinforce its overall look. Get your services for the prevention of discoloration, corrosion, and deterioration of this buildings in addition to towers.

Avatar_small
nanny services in du 说:
2021年9月04日 15:15

Some folks may believe this write-up contains a motivational concept, but simply no... this article can be a call for action. And plenty of it. Also defined as "Massive action". I undoubtedly don't desire to scare any person away with all the word "massive", but at times it's required to provide possible check. If you believe you're planning to see success inside the cleaning simply by sticking any yellow site ad search inside the phone book to get a good business, good luck your.

Avatar_small
home cleaning dubai 说:
2021年9月19日 19:43

It's going to be a plan of action to generate a home place of work. In the process, you can maintain your home and also the office and you will probably feel a lesser amount of stressed. Your own home environment will build a healthy work place. The cleanup process will likely become uncomplicated. Furthermore, the interior infrastructure of your home office are going to be well-maintained.

Avatar_small
NCERT Chemistry Ques 说:
2022年9月24日 02:15 Advised to download NCERT 9th Class Chemistry Sample Paper 2023 to know about the Paper-1 & Paper-2 new exam scheme or question paper style for Term-1 & Term-2 exams of SA1, SA2, FA1, FA2, FA3, FA4, Assignments and other types of exams. NCERT Chemistry Question Paper Class 9 Those who download and studied the NCERT learning & study material of Chemistry can easily get top scores by practising with regular revisions and mock test exams.

登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter