lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sat, 11 Nov 2006 19:22:40 +0100 (MET)
From:	Jan Engelhardt <jengelh@...ux01.gwdg.de>
To:	ranjith kumar <ranjit_kumar_b4u@...oo.co.uk>
cc:	linux-kernel@...r.kernel.org
Subject: Re: printk in user mode program

>Hi all,
>
>I got compilation errors when I compiled the below
>program by the command "gcc 1.c". 

That's not the right way to compile a kernel file. And probably neither 
is for a userspace program (you want at least the -o switch, and most 
likely -Wall)

>
>Note: I inluded printk instead of printf because I
>have to call the executable code, produced by
>compiling the below code, in a kernel module using
>call_usermodehelper().

If you write a userspace program, use userspace functions.

>
> Please help me.
>Thanks in advance.
>
>---------------------------------------------
>#include<stdio.h>
>#include<linux/module.h>
>#include<linux/kernel.h>
>int main(int argc,char **argvp,char **envp)
>{
>int a,b,c,d;
>for(a=0;a<99999;a++)
>for(d=0;d<9;d++)
>//for(b=0;b<9999;b++)
>c++;
>printk(KERN_INFO "USER PROGRAM \n");
>
>return 0;
>
>}
>-------------------------------------------------
>compilation errors:
>
>1.c: In function `main':
>1.c:11: error: `KERN_INFO' undeclared (first use in
>this function)
>1.c:11: error: (Each undeclared identifier is reported
>only once
>1.c:11: error: for each function it appears in.)
>1.c:11: error: syntax error before string constant
>
>
>Send instant messages to your online friends http://uk.messenger.yahoo.com 
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@...r.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at  http://www.tux.org/lkml/
>

	-`J'
-- 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ