• ベストアンサー
※ ChatGPTを利用し、要約された質問です(原文:gettidについて)

gettidについて

このQ&Aのポイント
  • プログラムでgettid関数を使用しようとしているが、コンパイルエラーが発生する。
  • カーネルは2.4.18で、以下のエラーメッセージが表示される。
  • 原因がわからず、正しい記述にしているつもり。ご助言をお願いしたい。

質問者が選んだベストアンサー

  • ベストアンサー
回答No.1

使い方に問題があるわけではなく、カーネルやカーネルヘッダのバージョンの問題だと思います。 カーネルヘッダとカーネルソース(インストール場所は/usr/src/linux-2.4/)があるという前提で、以下のコマンドを実行してみてください。 (1) grep gettid /usr/include/asm/unistd.h (2) grep gettid /usr/src/linux-2.4/arch/i386/kernel/entry.S (1),(2)ともに結果が表示されない場合は、カーネルヘッダとカーネルのバージョンアップを、 (1)だけ表示されない場合は、カーネルヘッダのバージョンアップを試されてはいかがでしょうか?

baffo
質問者

お礼

アドバイス恐れ入ります。 (1)、(2)ともに実行してみましたが、結果表示されませんでした。 LINUXごとバージョンを新しくしてみたらうまく出来ました。 ありがとうございました。

全文を見る
すると、全ての回答が全文表示されます。

関連するQ&A

  • エラーの対策

    インターネット上で他の方のC言語ソースコードをダウンロードした、MAKEでコンパイルしたときに、以下のエラーはでました、どうしたらいいでしょうか? gcc -pipe -ansi -c -o base.o base.c base.c: In function `Setup': base.c:535: `S_IFDIR' undeclared (first use in this function) base.c:535: (Each undeclared identifier is reported only once base.c:535: for each function it appears in.) make: *** [base.o] Error 1

  • MinGWとmsysでGTK+の開発環境を整えたい

    WindowsXP上で、コンパイラにMinGWを用いてGTK+2.0を用いたGUIアプリケーションの開発を行いたいと思っています。 しかし、GTK+2.0のサンプルソースのコンパイルが通りません。 コマンドとそのエラーは以下の通りです。 どうもヘッダーが見つからないと言っているようですが、ヘッダーをコンパイラのincludeフォルダに入れても駄目でした。 いれたGTK+はGlade等、全てがパックになっているものでした。インストール時にmsysを認識してくれていたので、勝手に設定をしてくれるのかと思ったのですが…。 $ gcc hello_gtk.c 'pkg-config gtk+-2.0 --cflags' hello_gtk.c:1:21: gtk/gtk.h: No such file or directory hello_gtk.c: In function `main': hello_gtk.c:5: error: `GtkWidget' undeclared (first use in this function) hello_gtk.c:5: error: (Each undeclared identifier is reported only once hello_gtk.c:5: error: for each function it appears in.) hello_gtk.c:5: error: `window' undeclared (first use in this function) hello_gtk.c:6: error: `label' undeclared (first use in this function) hello_gtk.c:10: error: `GTK_WINDOW_TOPLEVEL' undeclared (first use in this function) gcc.exe: pkg-config gtk+-2.0 --cflags: No such file or directory どうすれば、コンパイルできるようになるのでしょう?

  • エラーが出てコンパイルができません…

    #include<stdio.h> void main(void) { int i; i=0; while(i<3){ printf("おーい\n\"); printf(" やっほー\n\n\"); i=i+1; } printf("プログラムを終了します\"); } と本に書いてあった通りに入力したら、下のようなエラーが出てきました。 7: 文法エラー before \"i\" 9: stray \'\\\' in program 10: stray \'\\\' in program 10: 文法エラー before \"n\" 11: stray \'\\\' in program 11: 文法エラー before \"n\" 12: `i\' undeclared (first use in this function) 12: (Each undeclared identifier is reported only once 12: for each function it appears in.) トップレベル: 15: error: 文法エラー before string constant 15: conflicting types for built-in function `printf\' 15: data definition has no type or storage class 16:2: ファイル末尾に改行がありません 解決策と原因を教えて下さい。 宜しくお願い致します。

  • プログラムのご指摘

    ファイルを読み込み、英字のみか、先頭が英字で二文字目以降が英字または数字である文字列を出力するプログラムを作りたいです。 #include<string> #include<fstream> #include<cctype> #include<iostream> int main (){ char c; std::string key; std::ifstream fin( "1234.txt"); if( fin.fail() ){ std::cerr << "ファイルを開けませんでした" << std::endl; exit(1); } while (fin >> get(c)){ if(!isalpha(c)) continue; key = tolower(c); while (fin >> get(c)){ if (!isalnum(c)){ key.unget(); break; } key = tolower(c); } break; std::cout << key; } } このようなプログラムを作りましたが、↓のエラーが出ていました。 どなたご指摘願います。 エラーメッセージ: sou2-1.cpp: In function `int main()': sou2-1.cpp:20: error: `get' undeclared (first use this function) sou2-1.cpp:20: error: (Each undeclared identifier is reported only once for each function it appears in.) sou2-1.cpp:25: error: `unget' undeclared (first use this function)

  • Apache2インストールでpcre_default_tables未定義エラー

    こんにちは、honiyonです。  RedHat LinuxにApache2をソースからインストールしようとしています。  tar xzvf で展開し、   ./configure --enable-modules=so --enable-ssl   make  としたところ、 pcre.c: In function `pcre_compile': pcre.c:2534: `pcre_default_tables' undeclared (first use in this function) pcre.c:2534: (Each undeclared identifier is reported only once  とエラーが出ました。  原因が分からなかったので、pcre-6.3.tar.gz を使って無理やり(?)コンパイルを通すと、今度は util.c: In function `ap_find_token': util.c:1456: `test_char_table' undeclared (first use in this function) util.c:1456: (Each undeclared identifier is reported only once util.c:1456: for each function it appears in.) util.c:1456: `T_HTTP_TOKEN_STOP' undeclared (first use in this function) util.c: In function `ap_escape_shell_cmd': util.c:1520: `test_char_table' undeclared (first use in this function) ...~後略~  とエラーが出ました。  Apacheのバージョンは、2.0.54と2.0.46を試していますが、同じエラーとなっています。  う~ん、何か不足しているのでしょうか?  VineLinuxで同様のmakeをした時はすんなり成功しました。  何かお気づきの点がありましたら、是非ご教示ください。  因みに、このLinuxのunameの結果は uname -s Linux uname -m i686 uname -r 2.4.20-8smp uname -v #1 SMP Thu Mar 13 17:45:54 EST 2004  gcc -v は RedHat Linux 3.2.2-5  です。  宜しくお願いします(..

  • gccですが、コンパイルができません!

    以下のプログラムですが #include <stdio.h> int main() { Int col; char i; scanf( "%d", &col ); for( i = 0 ; i < 26 ; i++ ){ if( i > 0 && ( i % col ) == 0 ) printf( "\n" ); printf( "%c", 'a' + i ); } return 0; } 以上のプログラムをgccでコンパイルしました。 コンパイルするために入力した文字→  gcc p.c -o p.exe 以下のエラーがでてコンパイルできません。 p.c: In function `main': p.c:4: error: `Int' undeclared (first use in this function) p.c:4: error: (Each undeclared identifier is reported only once p.c:4: error: for each function it appears in.) p.c:4: error: syntax error before "col" p.c:7: error: `col' undeclared (first use in this function) p.c:17:2: warning: no newline at end of file  以上なぜコンパイルができないのですか? よろしくお願いいたします。

  • このプログラム見てもらえますか?

    問題は十進数二桁の正整数をgetchar()を用いて文字型の変数xとyから元の10進二桁の正整数を復元して整数型変数zに格納せよ zをprintf()で出力し正しく格納されていることを格納せよ。です #include<stdio.h> int main(void) { char x[256],y[256]; int z; printf("整数を一文字入力して下さい。\n"); x=getchar(); printf("整数を一文字入力して下さい。\n"); y=getchar(); z=x*10+y; printf("%d\n",z); return(0); } これをコンパイルすると kadai5-5.c: In function `main': kadai5-5.c:9: incompatible types in assignment kadai5-5.c:11: incompatible types in assignment kadai5-5.c:12: `zyuu' undeclared (first use in this function) kadai5-5.c:12: (Each undeclared identifier is reported only once kadai5-5.c:12: for each function it appears in.) kadai5-5.c:13: `iti' undeclared (first use in this function) kadai5-5.c:14: invalid operands to binary + こう表示されます。 C言語の参考書片手に試行錯誤してるんですがなかなかできません。 よろしくおねがいします。

  • コンパイルエラーの原因がわからず困っています。

    こんにちわ。いつもお世話になっております。 自分で構造体を定義して、それを使ってみたのですがコンパイルエラーが出てしまいます。何がいけないのでしょうか。 以下がそのプログラムです。 struct list { struct list *prev; struct in_addr ip_src, ip_dst; u_short th_sport; u_short th_dport; struct list *next; }; void main (u_char * args, const struct pcap_pkthdr *header, const u_char * packet) { static int count = 1; const sturct list *flow; return; } 以上です。 エラー内容は test.c: In function ‘main’: test.c:17: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘list’ test.c:17: error: ‘list’ undeclared (first use in this function) test.c:17: error: (Each undeclared identifier is reported only once test.c:17: error: for each function it appears in.) test.c:17: error: ‘flow’ undeclared (first use in this function) 以上です。 どんな些細な意見でも構いませんので、何か気が付かれたら教えて頂けないでしょうか。どうぞよろしくお願いします。

  • セグメンテーションエラーの原因がわからず困っています。

    こんにちは。 プログラムを実行すると「セグメンテーションエラー」と表示されほとほと困っています。力を貸して頂けないでしょうか。 以下がそのプログラムです。 #include<string.h> #include<unistd.h> #include<errno.h> #include<signal.h> #include<sys/types.h> main(){ FILE *fp,*fp2; int a; pid_t pid; pid = fork(); if(pid == 0){ fp = popen("tcpdump 'tcp[13] & 255 == 2' > file.txt","r"); system("sleep 1"); kill(pid,SIGTERM); } else{ fp2 = popen("wc -l file.txt","r"); fscanf(fp2,"%3d",a); printf("%d",a); } } プログラムの内容は、子プロセスとして動かしたtcpdumpにより出力されたfile.txtの行数を表示するものです。 tcpdumpを子プロセス化したのは、killコマンドで終了しないと止まらないからです。 以上で何か気づかれた事等ありましたら、是非ご教授いただきたいのですが可能でしょうか。環境はCentosです。どうぞよろしくお願いします。

  • GNUから、cat.cのソースコードを手に入れたが、コンパイルできない

    OSは、Ubuntu 8.04 LTSを使用しています。 C言語の勉強をしようと思い、 http://cvs.savannah.gnu.org/viewvc/coreutils/coreutils/src/ からcat.cのソースコード(1.113)を手に入れました。 ただ、試しにコンパイルをしようとすると、以下のようなエラーが出てコンパイルできません。 --- cat.c:24:20: error: config.h: No such file or directory cat.c:37 から include されたファイル中: system.h:56:21: error: pathmax.h: No such file or directory system.h:58:24: error: configmake.h: No such file or directory system.h:123:22: error: exitfail.h: No such file or directory In file included from cat.c:37: system.h: In function ‘initialize_exit_failure’: system.h:130: error: ‘exit_failure’ undeclared (first use in this function) system.h:130: error: (Each undeclared identifier is reported only once system.h:130: error: for each function it appears in.) system.h:236:25: error: stat-macros.h: No such file or directory system.h:238:22: error: timespec.h: No such file or directory system.h:266:21: error: gettext.h: No such file or directory 以下、エラー文が続く --- 何かをインストールする必要があるらしいことは分かるのですが、具体的に何をインストールすれば良いのかが分かりません。初歩的な質問で申し訳ありませんが、お教え願えないでしょうか?