Sponsored Content
Full Discussion: 32bit to 64bit conversion.
Top Forums Programming 32bit to 64bit conversion. Post 72161 by demuynckr on Thursday 19th of May 2005 07:47:15 AM
Old 05-19-2005
32bit to 64bit conversion.

Is there an 'easy' way to convert 32Bit code to 64Bit code. I have this benchmark i need to run on different machines and it would be nice if i could run it on the 64 bit machines ass wel.
The output when compiling(1) and running(2) are the following:
(1)
Code:
linux:/home/user1/subbench/heapsort # make
gcc -DUNIX -O2 heapsort.c -o heapsort
heapsort.c: In function `main':
heapsort.c:85: warning: return type of `main' is not `int'
heapsort.c: In function `HSORT':
heapsort.c:207: warning: cast to pointer from integer of different size

(2)
Code:
linux:/home/user1/subbench/heapsort # ./heapsort

   Heap Sort C Program
   Version 1.0, 04 Oct 1992

   Size of long (bytes): 8

   Array Size    RunTime      Scale    MIPS
    (bytes)       (sec)
        16000     0.0003     0.4202 1250.89
        32000     0.0007     0.9087 1264.42
        64000     0.0015     1.9536 1302.59
       128000     0.0032     4.1799 1311.54
Segmentation fault

The make file and source file can be found here if you want to have a look at it yourself.
http://users.pandora.be/steviewilliams/heapsort.zip
Mind that my knowledge of C is very basic Smilie.
Greetz
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

32bit vs 64bit

Whats the difference between 32bit and 64bit OS's or applications. I understand it a little but its just not clicking the way the teacher explained to me thanks, any info would be much appreciated (1 Reply)
Discussion started by: eloquent99
1 Replies

2. UNIX for Dummies Questions & Answers

64bit- or 32bit- processor

when using the command : cat /proc/cpuinfo I get some basic info back on the cpu.. but it doesn't tell me if I am using a 64 or 32 bit processor .. a) is this the right command to find this ? b) if it is not what is ? and how do I get that information.. thanx moxxx68 (2 Replies)
Discussion started by: moxxx68
2 Replies

3. Linux

Linux 32bit or 64bit

Hi, I want to know what is command to know which will tell wheather linux is 32 or 64 bit (5 Replies)
Discussion started by: manoj.solaris
5 Replies

4. Linux

Linux version v.s. 32bit/64bit

Where can I get a list that maps the each Linux version to corresponding 32/64 bits model? e.g. OS -> Model (ILP32, LP64, ...) RHLE3 -> ? RHLE4 -> ? RHLE5 -> ? ... It would be better if there is such a list that contains most of current UNIX OS versions. ... (1 Reply)
Discussion started by: princelinux
1 Replies

5. Solaris

32bit / 64bit issue with x86 solaris

i have solaris 10 x86 64bit installed on my pc (dell 3100). i then decided to move my hard drive to another pc (dell 4600). I noticed that each time i boot up, the OS show as 32 bit (instead of 64bit) and i can't even get past this stage to the login page. when i moved it back to dell 3100 it... (13 Replies)
Discussion started by: seyiisq
13 Replies

6. Solaris

32bit or 64 bit

Not really a Unix question as such :o, but what advantages or disadvantages are there between using 32bit or 64bit applications on a T5220 running Solaris 10? What about mixing them e.g. 64 bit app using 32 bit libraries or vice versa? (1 Reply)
Discussion started by: JerryHone
1 Replies

7. Red Hat

Pthread problems, 32bit vs 64bit

I have an application which builds and executes without error on a 32bit implementation of Linux. When I transferred the code to a new project on a 64bit implementation, the code will build without error, but the pthread functions, such as pthread_attr_setschedparam() return an 'Invalid Argument'... (3 Replies)
Discussion started by: jpelletier116
3 Replies

8. Solaris

Compiler - 32bit or 64bit?

Hi Gurus, I need to check whether the compiler installed in my system supports 64bit compilation. Server - Sun fire v490 OS - Solaris 5.9 Processor - Sparcv9 (64bit) Install Directory - /opt/SUNWSpro Compiler Model - Sun Forte C Compiler. My development team is claiming that there... (20 Replies)
Discussion started by: Hari_Ganesh
20 Replies

9. Shell Programming and Scripting

maintain 32bit and 64bit C code

Hi, I have a C code which builds and works fine on 32bit linux machine. Now i want to convert that code to build and run on 64 bit linux machine. I dont want to maintain two separate sources for 32 and 64 bit build. Same source should get build on 32 as well as 64 bit machine (when a... (2 Replies)
Discussion started by: bhushan123
2 Replies

10. SuSE

Libcap.so.2 for SuSE 10 (32bit)

Hello, I am trying to use a worktool on SLES 10 (32-bit) and it is saying I do not have libcap.so.2: error while loading shared libraries: libcap.so.2: cannot open shared object file: No such file or directory Is there an easy way for me to install this library? A quick Google search... (4 Replies)
Discussion started by: bstring
4 Replies
GETPWENT(3)						     Library Functions Manual						       GETPWENT(3)

NAME
getpwent, getpwuid, getpwnam, setpwent, endpwent - get password file entry SYNOPSIS
#include <pwd.h> struct passwd *getpwent(); struct passwd *getpwuid(uid) int uid; struct passwd *getpwnam(name) char *name; int setpwent(); int endpwent(); DESCRIPTION
Getpwent, getpwuid and getpwnam each return a pointer to an object with the following structure containing the broken-out fields of a line in the password file. /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* * POSIX Standard: 9.2.2 User Database Access <pwd.h> */ #ifndef _PWD_H #define _PWD_H 1 #include <features.h> __BEGIN_DECLS #include <bits/types.h> #define __need_size_t #include <stddef.h> #if defined __USE_XOPEN || defined __USE_XOPEN2K /* The Single Unix specification says that some more types are available here. */ # ifndef __gid_t_defined typedef __gid_t gid_t; # define __gid_t_defined # endif # ifndef __uid_t_defined typedef __uid_t uid_t; # define __uid_t_defined # endif #endif /* The passwd structure. */ struct passwd { char *pw_name; /* Username. */ char *pw_passwd; /* Password. */ __uid_t pw_uid; /* User ID. */ __gid_t pw_gid; /* Group ID. */ char *pw_gecos; /* Real name. */ char *pw_dir; /* Home directory. */ char *pw_shell; /* Shell program. */ }; #ifdef __USE_MISC # include <bits/types/FILE.h> #endif #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Rewind the password-file stream. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void setpwent (void); /* Close the password-file stream. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void endpwent (void); /* Read an entry from the password-file stream, opening it if necessary. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct passwd *getpwent (void); #endif #ifdef __USE_MISC /* Read an entry from STREAM. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern struct passwd *fgetpwent (FILE *__stream) __nonnull ((1)); /* Write the given entry onto the given stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int putpwent (const struct passwd *__restrict __p, FILE *__restrict __f); #endif /* Search for an entry with a matching user ID. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct passwd *getpwuid (__uid_t __uid); /* Search for an entry with a matching username. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct passwd *getpwnam (const char *__name) __nonnull ((1)); #ifdef __USE_POSIX # ifdef __USE_MISC /* Reasonable value for the buffer sized used in the reentrant functions below. But better use `sysconf'. */ # define NSS_BUFLEN_PASSWD 1024 # endif /* Reentrant versions of some of the functions above. PLEASE NOTE: the `getpwent_r' function is not (yet) standardized. The interface may change in later versions of this library. But the interface is designed following the principals used for the other reentrant functions so the chances are good this is what the POSIX people would choose. */ # ifdef __USE_MISC /* This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getpwent_r (struct passwd *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct passwd **__restrict __result) __nonnull ((1, 2, 4)); # endif extern int getpwuid_r (__uid_t __uid, struct passwd *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct passwd **__restrict __result) __nonnull ((2, 3, 5)); extern int getpwnam_r (const char *__restrict __name, struct passwd *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct passwd **__restrict __result) __nonnull ((1, 2, 3, 5)); # ifdef __USE_MISC /* Read an entry from STREAM. This function is not standardized and probably never will. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fgetpwent_r (FILE *__restrict __stream, struct passwd *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct passwd **__restrict __result) __nonnull ((1, 2, 3, 5)); # endif #endif /* POSIX or reentrant */ #ifdef __USE_GNU /* Re-construct the password-file line for the given uid in the given buffer. This knows the format that the caller will expect, but this need not be the format of the password file. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getpw (__uid_t __uid, char *__buffer); #endif __END_DECLS #endif /* pwd.h */ The fields pw_quota and pw_comment are unused; the others have meanings described in passwd(5). Getpwent reads the next line (opening the file if necessary); setpwent rewinds the file; endpwent closes it. Getpwuid and getpwnam search from the beginning until a matching uid or name is found (or until EOF is encountered). FILES
/etc/passwd SEE ALSO
getlogin(3), getgrent(3), passwd(5) DIAGNOSTICS
Null pointer (0) returned on EOF or error. BUGS
All information is contained in a static area so it must be copied if it is to be saved. GETPWENT(3)
All times are GMT -4. The time now is 12:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy