From: Florian Lehmann <flo.lehmann-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
To: linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: man crypt: #define __USE_XOPEN on 64-bit systems
Date: Sat, 30 Oct 2010 16:08:50 +0200 [thread overview]
Message-ID: <1288447730.1866.10.camel@hobbes> (raw)
[-- Attachment #1: Type: text/plain, Size: 666 bytes --]
Dear all,
I am using
Linux hobbes 2.6.35-22-generic #35-Ubuntu SMP Sat Oct 16 20:45:36 UTC
2010 x86_64 GNU/Linux
with manpages
Version: 3.24-1ubuntu1
I was trying to run a simple c-program using the function crypt from
unistd.h
Tha manpages states to define the macro _XOPEN_SOURCE in order to use
this function. This works fine on a 32-bit Version of Ubuntu 10.10. On
the mentioned 54-bit system the program could not be compiled.
On those systems you also have to define the macro __USE_XOPEN.
I attached the program. Just compile with
gcc -Wall crypter.c -lcrypt #will not work without __USE_XOPEN
Thanks a lot and best regards from Ulm,
Florian Lehmann
[-- Attachment #2: crypter.c --]
[-- Type: text/x-csrc, Size: 264 bytes --]
#include <stdio.h>
#define _XOPEN_SOURCE
#define __USE_XOPEN//needed on 64-bit
#include <unistd.h>
#include <string.h>
int main(){
char pwd[9]="asd2/ASD";
char sa[20];
strcpy(sa,(char*)crypt(pwd,"xx") );
printf("xx-crypted pw: %s\n",sa);
return 0;
}
next reply other threads:[~2010-10-30 14:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-30 14:08 Florian Lehmann [this message]
2010-10-31 5:07 ` man crypt: #define __USE_XOPEN on 64-bit systems Michael Kerrisk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1288447730.1866.10.camel@hobbes \
--to=flo.lehmann-gm/ye1e23mwn+bqq9rbeug@public.gmane.org \
--cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox