我正在使用Kubuntu 12.04,gcc 4.6.3.如果我创建一个pthread,请使用fopen64然后fgets - 它是segfaults.用fopen替换fopen64的相同代码 - 它成功了.没有创建pthread - 它成功了.那么为什么失败呢?这是代码:
#include <stdio.h>
#include <pthread.h>
typedef struct threadArgs
{
char* argsList;
int argc;
} threadArgs;
void
threadRun(void *pArg);
int
main(int argc, char* argv[])
{
int err = 0;
threadArgs thrArgs;
pthread_t thrd;
if (argc > 1)
{
printf("creating thread \n");
err = pthread_create (&thrd, NULL, (void *) &threadRun, (void *) &thrArgs);
printf("pthread_create returned: %d \n", err);
pthread_join(thrd, NULL);
}
else
{
printf("no thread - just calling func \n");
threadRun((void*)&thrArgs);
}
printf("Exiting main() …Run Code Online (Sandbox Code Playgroud) 在我的样式表中,我尝试将输入参数的默认值设置为以点字符开头的字符串。并且总是收到错误代码 0x8004005 - 预期的 toden 'eof' 找到 'NAME'。例如:
<xsl:param name="p1" select=".exe"/>
Run Code Online (Sandbox Code Playgroud)
然而,点后面的内容并不重要。总是同样的错误。如何形成该字符串以包含第一个点?