Why #pragma pack() not take effect?

unix

    Next

  • 1. g++ under cygwin and includepaths?
    I have installed Cygwin, g++ and make under Windows Vista. I have then made a main.cpp file that includes: #include <boost/shared_ptr.hpp> In my makefile I have: CC = g++ INC=-IC:\Program Files (x86)\boost all: main main: main.cpp g++ main.cpp -o main $(INC) but it does not accept the windows path to boost. How do I specify includepath to boost in windows Vista?
  • 2. socket async io
    can i use fcntl(socket_fd, F_SETSIG, signum) to get asycn event on socket_fd with socket.
  • 3. flex: doubt regarding the meaning of some character classes
    After browsing the flex manual I've stumbled on the patterns section where it is said that patterns can be expressed with the help of character class expressions. The patterns are as follows: [:alnum:] [:alpha:] [:blank:] [:cntrl:] [:digit:] [:graph:] [:lower:] [:print:] [:punct:] [:space:] [:upper:] [:xdigit:] Some of those patterns appear to be straight forward but I don't have a clue regarding the exact meaning of a whole bunch of them. To make matters worse, it appears that there is absolutely no information covering that, not only in the flex manual but also anywhere. So, could anyone please post the meaning of those character classes? Thanks in advance Rui Maciel
  • 4. How to know if malloc.h is available?
    Hi, is there a way to know if the header file malloc.h is available? I mean, is there some cpp macro to test, like for example macros defined in standards or specifications like SVID, XPG, POSIX,... or unix flavour like __sun? I have this piece of code: #if defined (__sun) || defined (__i386) || defined (__ia64) #include <malloc.h> #define HAVE_MALLINFO #endif It compiles on linux (x86, x86_64 and itanium) and on Solaris (SPARC) but it doesn't compile on Mac OS X (x86), where the compiler (gcc from XCode 3.1.1) can't find malloc.h . Now, I'm pretty new with Mac but I think the test above should make use of "more portable" macros. Thanks for your help.
  • 5. Obtain filenames from a directory (Pcap program)
    Hi all, I'm writing a program using libpcap, and I have multiple pcap files in a folder that I want to capture. I currently have handle = pcap_open_offline("/data/traffic/pcap1.pcap", errbuf"); which works fine since pcap_open_offline() takes in a filename. However, I want to process multiple pcap files from the directory / data/traffic/ at once. Is there a way to do that? Thank you. Regards, Rayne

Why #pragma pack() not take effect?

Postby Jimmy » Wed, 04 Jul 2007 16:15:55 GMT

Struct definition as following(on 32-bit Linux):

#pragma pack(push, 8)
struct MY_STRUCT
{
    char a[2];
    short b;
    short c;
    short d;
    int e;
    long long x;
    long long y;
};
#pragma(pop)

During the test, result of 'sizeof(struct MY_STRUCT)' is 28. Why not 32?
As I had expected, a,b,c,d will be packed into one 8-byte, e one and x, y
two. Ain't I right?

If I get wrong usage of #pragma pack(), could anyone please tell me how to
get it work correctly?

BTW, what on earth is the difference between __attribute__ align() and
#pragma pack()?

Thanks in advance!



Re: Why #pragma pack() not take effect?

Postby Spoon » Wed, 04 Jul 2007 17:18:55 GMT




What compiler on which platform are you using?

 http://www.**--****.com/ 

-fpack-struct[=n]

     Without a value specified, pack all structure members together 
without holes. When a value is specified (which must be a small power of 
two), pack structure members according to this value, representing the 
maximum alignment (that is, objects with default alignment requirements 
larger than this will be output potentially unaligned at the next 
fitting location.

What are you trying to accomplish?

You seem to actually want padding instead of packing.

Re: Why #pragma pack() not take effect?

Postby Jimmy » Wed, 04 Jul 2007 17:54:24 GMT



My platform is Red Hat Linux Enterprise 3. And I tried both gcc and cc and
got the same result.


 http://www.**--****.com/ 

Right, but it will take effect on all structs in the file compiled with this
option.



struct MY_STRUCT
{
    char a[2];
    short b;
    short c;
    short d;
    int e;              /* int e __attribute__ align(8);  */
    long long x;
    long long y;
};

    Actually yes. I want to get the member e 32-bit padded  wherea it can
have the
same structure as on a 64-bit platform such as HP-UX ia64.
    I can accomplish that via the commented form. However it's too
troublesome to
get all structs modified one by one, isn't it?



Why #pragma pack() not take effect?

Postby Jimmy » Wed, 04 Jul 2007 18:26:40 GMT

>

Correct, the comment should be /* int e __attribute__ ((aligned(64)));  */



Re: Why #pragma pack() not take effect?

Postby jt » Wed, 04 Jul 2007 18:53:39 GMT






That's not enought information. You also need to know the archi-
tecture. And even different compilers on the same machine are in
principle allowed to use different sizes for the same type (and
use numbers of padding bytes in structures).






Padding can only be set in bytes, not bits (and byte meaning
the smallest addressable unit on the machine, not an 8-bit
quantity, so a byte could also have 16 or 32 bits or even 9
on some strange machines).


But then alignment isn't your only problem - there's also the
question of endian-ness. And, of course, neither a short, an
int or a long long need to have the same size on two different
architectures (and even if the result of sizeof is the same on
two machines this doesn't guarantee that the values have the
same number of bits). And things get even more interesting if
you throw floating point types into the mix;-)

The usual way to store data so that they can be exchanged
reliably between different systems (unless you want to re-
strict yourself to the exchange between systems for which
you know exactly how data are stored) is to convert  the
data to and store in ASCII.


Since it's rarely useful it's probably not really troublesome,
unless you're trying to use it for something it was not meant
for.
                              Regards, Jens
-- 
  \   Jens Thoms Toerring  ___       XXXX@XXXXX.COM 
   \__________________________       http://www.**--****.com/ 

Re: Why #pragma pack() not take effect?

Postby Spoon » Wed, 04 Jul 2007 19:27:58 GMT






Which architecture?


What's cc?

$ ls -l `which cc`


What size in bits do you expect for a char?
for a short?
for an int?
for a long long?

You might want to use the types defined in stdint.h
 http://www.**--****.com/ 


You might try asking on the GCC mailing list.

Re: Why #pragma pack() not take effect?

Postby Keith Thompson » Thu, 05 Jul 2007 04:37:32 GMT

"Jimmy" < XXXX@XXXXX.COM > writes:


[...]

That's hardly surprising:

% cat /etc/redhat-release 
Red Hat Enterprise Linux WS release 3 (Taroon Update 8)
% ls -l /usr/bin/cc
lrwxrwxrwx    1 root     root            3 Apr  2 16:20 /usr/bin/cc -> gcc

-- 
Keith Thompson (The_Other_Keith)  XXXX@XXXXX.COM   < http://www.**--****.com/ ~kst>
San Diego Supercomputer Center             <*>  < http://www.**--****.com/ ~kst>
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

Similar Threads:

1.one pragma pack vs. many, many __attribute__((packed))

2.[PATCH] Fix pragma packing in ip2 driver

3.FPATH taking effect but functions not properly invoked

I have the following sample shell script called
priv_lib_prod_drone.ksh:
#!/usr/bin/ksh

set -x
if [[ ${LOGNAME} = 'privbtch' ]]
then
   export STORE_HOME=/prod/home01/store/privacy
elif [[ ${LOGNAME} = 'u96010' ]]
then
   export STORE_HOME=${HOME}
   exec 1>>${HOME}/outputlog 2>&1
fi

touch 200604231200 ${STORE_HOME}/data/privacy_drone_0423.dat
touch 200604241200 ${STORE_HOME}/data/privacy_drone_0424.dat

unset FPATH
echo "FPATH variable and PATH are not set up yet: "
echo "${FPATH} is FPATH"
echo "${PATH} is PATH"
echo "Drone files before purge is invoked:........"
ls -l ${STORE_HOME}/data/privacy_drone*

purge ${STORE_HOME}/data/privacy_drone*dat 15
echo "${?} is return code from purge function"
echo "Drone files after purge is invoked:........"
ls -l ${STORE_HOME}/data/privacy_drone*

# set FPATH
export FPATH=/prod/home01/appl/privacy/lib
export PATH=${PATH}:${FPATH}

echo "${FPATH} is FPATH"
echo "${PATH} is PATH"
echo "Drone files before purge is invoked:........"
ls -l ${STORE_HOME}/data/privacy_drone*

purge ${STORE_HOME}/data/'privacy_drone*' 15
echo "${?} is return code from purge function"
echo "Drone files after purge is invoked:........"
ls -l ${STORE_HOME}/data/privacy_drone*

Expalnation of the script:
Lines 16 - 26 Try to invoke the function "purge" without setting FPATH
Lines 28 - 40 Invoke function "purge" after setting FPATH and PATH.

purge is a function to delete all files older than "n" days where n is
the parameter to the function.
u96010@jake:/prod/home01/appl/privacy/lib-> ls -l
total 70
-rw-r-xr--   1 privprod   privbtch      5146 May  4 15:20 cstmarchive
-rw-r-xr--   1 privprod   privbtch      7515 May  4 15:20 fn_check_date
-rw-r-xr--   1 privprod   privbtch      2196 May  4 15:20 ftpctrl
-rw-r-xr--   1 privprod   privbtch       762 May  4 15:20 purge
-rw-r-xr--   1 privprod   privbtch      7562 May  4 15:20 xfrdata
-rw-r-xr--   1 privprod   privbtch      8311 May  4 15:20 xfrsignal

u96010@jake:/prod/home01/appl/privacy/lib-> cat purge
##########################################################################
#
 #
# File:         purge
 #
# Synopsis:     purge target_dir purge_days
 #
# Description:  Purge files in target_dir directory that are older than
 #
#               specified purge_days.
 #
# Return:       0       Successfully purge the files
 #
#               1       Failed to purge old files
 #
##########################################################################
function purge
{
    /usr/bin/find $1 -mtime +$2|/usr/bin/xargs rm -f
    if [[ $? -ne 0 ]]
    then
        return 1
    else
        return 0
    fi
}

When the job priv_lib_prod_drone.ksh is invoked as one user the script
is working as expected.
But if the script is executed as user privbtch, the script does runs as
follows -- trace file:

**********************************************************************************************************
+ set -x
+ [[ privbtch = privbtch ]]
+ export STORE_HOME=/prod/home01/store/privacy
+ touch 200604231200
/prod/home01/store/privacy/data/privacy_drone_0423.dat
+ touch 200604241200
/prod/home01/store/privacy/data/privacy_drone_0424.dat
+ unset FPATH
+ echo FPATH variable and PATH are not set up yet:
FPATH variable and PATH are not set up yet:
+ echo  is FPATH
 is FPATH
+ echo
/opt/oracle/product/8.1.7.4/bin:/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/fc/bin:/opt/fcms/
bin:/opt/upgrade/bin:/opt/pd/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/hparray/bin:/opt/perf/bin:/opt/pred/bin:/opt/dlm/sbin:/u
sr/local/bin:/opt/omni/bin:/opt/hpnp//bin:/usr/local/bin:/opt/OV/bin/OpC:/opt/openspool/runtime-sw/bin:/opt/ignite/bin:/opt/resm
on/bin:/usr/sbin/diag/contrib:/opt/networker/bin:/opt/graphics/common/bin:/opt/OV/bin:/etc/pipc/bin:.
is PATH
/opt/oracle/product/8.1.7.4/bin:/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/fc/bin:/opt/fcms/bin:/op
t/upgrade/bin:/opt/pd/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/hparray/bin:/opt/perf/bin:/opt/pred/bin:/opt/dlm/sbin:/usr/loca
l/bin:/opt/omni/bin:/opt/hpnp//bin:/usr/local/bin:/opt/OV/bin/OpC:/opt/openspool/runtime-sw/bin:/opt/ignite/bin:/opt/resmon/bin:
/usr/sbin/diag/contrib:/opt/networker/bin:/opt/graphics/common/bin:/opt/OV/bin:/etc/pipc/bin:.
is PATH
+ echo Drone files before purge is invoked:........
Drone files before purge is invoked:........
+ ls -l /prod/home01/store/privacy/data/privacy_drone_0423.dat
/prod/home01/store/privacy/data/privacy_drone_0424.dat
-rw-rw-r--   1 privbtch   privbtch         0 Apr 23 12:00
/prod/home01/store/privacy/data/privacy_drone_0423.dat
-rw-rw-r--   1 privbtch   privbtch         0 Apr 24 12:00
/prod/home01/store/privacy/data/privacy_drone_0424.dat
+ purge /prod/home01/store/privacy/data/privacy_drone_0423.dat
/prod/home01/store/privacy/data/privacy_drone_0424.dat 15
/prod/home01/appl/privacy/bin/priv_lib_prod_drone.ksh[23]: purge:  not
found
+ echo 1 is return code from purge function
1 is return code from purge function
+ echo Drone files after purge is invoked:........
Drone files after purge is invoked:........
+ ls -l /prod/home01/store/privacy/data/privacy_drone_0423.dat
/prod/home01/store/privacy/data/privacy_drone_0424.dat
-rw-rw-r--   1 privbtch   privbtch         0 Apr 23 12:00
/prod/home01/store/privacy/data/privacy_drone_0423.dat
-rw-rw-r--   1 privbtch   privbtch         0 Apr 24 12:00
/prod/home01/store/privacy/data/privacy_drone_0424.dat
+ export FPATH=/prod/home01/appl/privacy/lib
+ export
PATH=/opt/oracle/product/8.1.7.4/bin:/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/fc/bin:/op
t/fcms/bin:/opt/upgrade/bin:/opt/pd/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/hparray/bin:/opt/perf/bin:/opt/pred/bin:/opt/dlm/
sbin:/usr/local/bin:/opt/omni/bin:/opt/hpnp//bin:/usr/local/bin:/opt/OV/bin/OpC:/opt/openspool/runtime-sw/bin:/opt/ignite/bin:/o
pt/resmon/bin:/usr/sbin/diag/contrib:/opt/networker/bin:/opt/graphics/common/bin:/opt/OV/bin:/etc/pipc/bin:.:/prod/home01/appl/p
rivacy/lib
+ echo /prod/home01/appl/privacy/lib is FPATH
/prod/home01/appl/privacy/lib is FPATH
+ echo
/opt/oracle/product/8.1.7.4/bin:/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/fc/bin:/opt/fcms/
bin:/opt/upgrade/bin:/opt/pd/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/hparray/bin:/opt/perf/bin:/opt/pred/bin:/opt/dlm/sbin:/u
sr/local/bin:/opt/omni/bin:/opt/hpnp//bin:/usr/local/bin:/opt/OV/bin/OpC:/opt/openspool/runtime-sw/bin:/opt/ignite/bin:/opt/resm
on/bin:/usr/sbin/diag/contrib:/opt/networker/bin:/opt/graphics/common/bin:/opt/OV/bin:/etc/pipc/bin:.:/prod/home01/appl/privacy/
lib is PATH
/prod/home01/appl/privacy/lib is FPATH
+ echo
/opt/oracle/product/8.1.7.4/bin:/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/fc/bin:/opt/fcms/
bin:/opt/upgrade/bin:/opt/pd/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/hparray/bin:/opt/perf/bin:/opt/pred/bin:/opt/dlm/sbin:/u
sr/local/bin:/opt/omni/bin:/opt/hpnp//bin:/usr/local/bin:/opt/OV/bin/OpC:/opt/openspool/runtime-sw/bin:/opt/ignite/bin:/opt/resm
on/bin:/usr/sbin/diag/contrib:/opt/networker/bin:/opt/graphics/common/bin:/opt/OV/bin:/etc/pipc/bin:.:/prod/home01/appl/privacy/
lib is PATH
/opt/oracle/product/8.1.7.4/bin:/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/fc/bin:/opt/fcms/bin:/op
t/upgrade/bin:/opt/pd/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/hparray/bin:/opt/perf/bin:/opt/pred/bin:/opt/dlm/sbin:/usr/loca
l/bin:/opt/omni/bin:/opt/hpnp//bin:/usr/local/bin:/opt/OV/bin/OpC:/opt/openspool/runtime-sw/bin:/opt/ignite/bin:/opt/resmon/bin:
/usr/sbin/diag/contrib:/opt/networker/bin:/opt/graphics/common/bin:/opt/OV/bin:/etc/pipc/bin:.:/prod/home01/appl/privacy/lib
is
PATH
+ echo Drone files before purge is invoked:........
Drone files before purge is invoked:........
+ ls -l /prod/home01/store/privacy/data/privacy_drone_0423.dat
/prod/home01/store/privacy/data/privacy_drone_0424.dat
-rw-rw-r--   1 privbtch   privbtch         0 Apr 23 12:00
/prod/home01/store/privacy/data/privacy_drone_0423.dat
-rw-rw-r--   1 privbtch   privbtch         0 Apr 24 12:00
/prod/home01/store/privacy/data/privacy_drone_0424.dat
+ purge /prod/home01/store/privacy/data/privacy_drone* 15
+ echo 0 is return code from purge function
0 is return code from purge function
+ echo Drone files after purge is invoked:........
Drone files after purge is invoked:........
+ ls -l /prod/home01/store/privacy/data/privacy_drone_0423.dat
/prod/home01/store/privacy/data/privacy_drone_0424.dat
-rw-rw-r--   1 privbtch   privbtch         0 Apr 23 12:00
/prod/home01/store/privacy/data/privacy_drone_0423.dat
-rw-rw-r--   1 privbtch   privbtch         0 Apr 24 12:00
/prod/home01/store/privacy/data/privacy_drone_0424.dat

************************************************************************************************************

If I run the same script as user u96010 (a different user that runs the
same script) the functions are invoked properly:
**********************************************************************************************************
FPATH variable and PATH are not set up yet:
 is FPATH
/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/fc/bin:/opt/fcms/bin:/opt/upgrade/bin:/opt/pd/bin:/usr/b
in/X11:/usr/contrib/bin/X11:/opt/hparray/bin:/opt/perf/bin:/opt/pred/bin:/opt/dlm/sbin:/usr/local/bin:/opt/omni/bin:/opt/hpnp//b
in:/usr/local/bin:/opt/OV/bin/OpC:/opt/openspool/runtime-sw/bin:/opt/ignite/bin:/opt/resmon/bin:/usr/sbin/diag/contrib:/opt/netw
orker/bin:/opt/graphics/common/bin:/opt/OV/bin:/etc/pipc/bin:/prod/home01/appl/privacy/lib
is PATH
Drone files before purge is invoked:........
-rw-r-----   1 u96010     madss            0 Apr 23 12:00
/prod/users/crmsdev/u96010/data/privacy_drone_0423.dat
-rw-r-----   1 u96010     madss            0 Apr 24 12:00
/prod/users/crmsdev/u96010/data/privacy_drone_0424.dat
1 is return code from purge function
Drone files after purge is invoked:........
-rw-r-----   1 u96010     madss            0 Apr 23 12:00
/prod/users/crmsdev/u96010/data/privacy_drone_0423.dat
-rw-r-----   1 u96010     madss            0 Apr 24 12:00
/prod/users/crmsdev/u96010/data/privacy_drone_0424.dat
/prod/home01/appl/privacy/lib is FPATH
/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/fc/bin:/opt/fcms/bin:/opt/upgrade/bin:/opt/pd/bin:/usr/b
in/X11:/usr/contrib/bin/X11:/opt/hparray/bin:/opt/perf/bin:/opt/pred/bin:/opt/dlm/sbin:/usr/local/bin:/opt/omni/bin:/opt/hpnp//b
in:/usr/local/bin:/opt/OV/bin/OpC:/opt/openspool/runtime-sw/bin:/opt/ignite/bin:/opt/resmon/bin:/usr/sbin/diag/contrib:/opt/netw
orker/bin:/opt/graphics/common/bin:/opt/OV/bin:/etc/pipc/bin:/prod/home01/appl/privacy/lib:/prod/home01/appl/privacy/lib
is PATH
Drone files before purge is invoked:........
-rw-r-----   1 u96010     madss            0 Apr 23 12:00
/prod/users/crmsdev/u96010/data/privacy_drone_0423.dat
-rw-r-----   1 u96010     madss            0 Apr 24 12:00
/prod/users/crmsdev/u96010/data/privacy_drone_0424.dat
0 is return code from purge function
Drone files after purge is invoked:........
0
0
1
1
+ touch 200604231200
/prod/users/crmsdev/u96010/data/privacy_drone_0423.dat
+ touch 200604241200
/prod/users/crmsdev/u96010/data/privacy_drone_0424.dat
+ unset FPATH
+ echo FPATH variable and PATH are not set up yet:
FPATH variable and PATH are not set up yet:
+ echo  is FPATH
 is FPATH
+ echo
/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/fc/bin:/opt/fcms/bin:/opt/upgrade/bin:/opt/pd/bin
:/usr/bin/X11:/usr/contrib/bin/X11:/opt/hparray/bin:/opt/perf/bin:/opt/pred/bin:/opt/dlm/sbin:/usr/local/bin:/opt/omni/bin:/opt/
hpnp//bin:/usr/local/bin:/opt/OV/bin/OpC:/opt/openspool/runtime-sw/bin:/opt/ignite/bin:/opt/resmon/bin:/usr/sbin/diag/contrib:/o
pt/networker/bin:/opt/graphics/common/bin:/opt/OV/bin:/etc/pipc/bin:/prod/home01/appl/privacy/lib
is PATH
/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/fc/bin:/opt/fcms/bin:/opt/upgrade/bin:/opt/pd/bin:/usr/b
in/X11:/usr/contrib/bin/X11:/opt/hparray/bin:/opt/perf/bin:/opt/pred/bin:/opt/dlm/sbin:/usr/local/bin:/opt/omni/bin:/opt/hpnp//b
in:/usr/local/bin:/opt/OV/bin/OpC:/opt/openspool/runtime-sw/bin:/opt/ignite/bin:/opt/resmon/bin:/usr/sbin/diag/contrib:/opt/netw
orker/bin:/opt/graphics/common/bin:/opt/OV/bin:/etc/pipc/bin:/prod/home01/appl/privacy/lib
is PATH
+ echo Drone files before purge is invoked:........
Drone files before purge is invoked:........
+ ls -l /prod/users/crmsdev/u96010/data/privacy_drone_0423.dat
/prod/users/crmsdev/u96010/data/privacy_drone_0424.dat
-rw-r-----   1 u96010     madss            0 Apr 23 12:00
/prod/users/crmsdev/u96010/data/privacy_drone_0423.dat
-rw-r-----   1 u96010     madss            0 Apr 24 12:00
/prod/users/crmsdev/u96010/data/privacy_drone_0424.dat
-rw-r-----   1 u96010     madss            0 Apr 23 12:00
/prod/users/crmsdev/u96010/data/privacy_drone_0423.dat
-rw-r-----   1 u96010     madss            0 Apr 24 12:00
/prod/users/crmsdev/u96010/data/privacy_drone_0424.dat
+ purge /prod/users/crmsdev/u96010/data/privacy_drone_0423.dat
/prod/users/crmsdev/u96010/data/privacy_drone_0424.dat 15
./priv_lib_prod_drone.ksh[23]: purge: cannot execute
+ echo 1 is return code from purge function
1 is return code from purge function
+ echo Drone files after purge is invoked:........
Drone files after purge is invoked:........
+ ls -l /prod/users/crmsdev/u96010/data/privacy_drone_0423.dat
/prod/users/crmsdev/u96010/data/privacy_drone_0424.dat
-rw-r-----   1 u96010     madss            0 Apr 23 12:00
/prod/users/crmsdev/u96010/data/privacy_drone_0423.dat
-rw-r-----   1 u96010     madss            0 Apr 24 12:00
/prod/users/crmsdev/u96010/data/privacy_drone_0424.dat
+ export FPATH=/prod/home01/appl/privacy/lib
+ export
PATH=/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/fc/bin:/opt/fcms/bin:/opt/upgrade/bin:/opt
/pd/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/hparray/bin:/opt/perf/bin:/opt/pred/bin:/opt/dlm/sbin:/usr/local/bin:/opt/omni/bi
n:/opt/hpnp//bin:/usr/local/bin:/opt/OV/bin/OpC:/opt/openspool/runtime-sw/bin:/opt/ignite/bin:/opt/resmon/bin:/usr/sbin/diag/con
trib:/opt/networker/bin:/opt/graphics/common/bin:/opt/OV/bin:/etc/pipc/bin:/prod/home01/appl/privacy/lib:/prod/home01/appl/priva
cy/lib
+ echo /prod/home01/appl/privacy/lib is FPATH
/prod/home01/appl/privacy/lib is FPATH
+ echo
/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/fc/bin:/opt/fcms/bin:/opt/upgrade/bin:/opt/pd/bin
:/usr/bin/X11:/usr/contrib/bin/X11:/opt/hparray/bin:/opt/perf/bin:/opt/pred/bin:/opt/dlm/sbin:/usr/local/bin:/opt/omni/bin:/opt/
hpnp//bin:/usr/local/bin:/opt/OV/bin/OpC:/opt/openspool/runtime-sw/bin:/opt/ignite/bin:/opt/resmon/bin:/usr/sbin/diag/contrib:/o
pt/networker/bin:/opt/graphics/common/bin:/opt/OV/bin:/etc/pipc/bin:/prod/home01/appl/privacy/lib:/prod/home01/appl/privacy/lib
is PATH
/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/fc/bin:/opt/fcms/bin:/opt/upgrade/bin:/opt/pd/bin:/usr/b
in/X11:/usr/contrib/bin/X11:/opt/hparray/bin:/opt/perf/bin:/opt/pred/bin:/opt/dlm/sbin:/usr/local/bin:/opt/omni/bin:/opt/hpnp//b
in:/usr/local/bin:/opt/OV/bin/OpC:/opt/openspool/runtime-sw/bin:/opt/ignite/bin:/opt/resmon/bin:/usr/sbin/diag/contrib:/opt/netw
orker/bin:/opt/graphics/common/bin:/opt/OV/bin:/etc/pipc/bin:/prod/home01/appl/privacy/lib:/prod/home01/appl/privacy/lib
is PATH
+ echo Drone files before purge is invoked:........
Drone files before purge is invoked:........
+ ls -l /prod/users/crmsdev/u96010/data/privacy_drone_0423.dat
/prod/users/crmsdev/u96010/data/privacy_drone_0424.dat
-rw-r-----   1 u96010     madss            0 Apr 23 12:00
/prod/users/crmsdev/u96010/data/privacy_drone_0423.dat
-rw-r-----   1 u96010     madss            0 Apr 24 12:00
/prod/users/crmsdev/u96010/data/privacy_drone_0424.dat
+ purge /prod/users/crmsdev/u96010/data/privacy_drone* 15
+ /usr/bin/xargs rm -f
+ /usr/bin/find /prod/users/crmsdev/u96010/data/privacy_drone_0423.dat
/prod/users/crmsdev/u96010/data/privacy_drone_0424.dat -m
time +15
+ [[ 0 -ne 0 ]]
+ return 0
+ echo 0 is return code from purge function
0 is return code from purge function
+ echo Drone files after purge is invoked:........
Drone files after purge is invoked:........
+ ls -l /prod/users/crmsdev/u96010/data/privacy_drone*
/prod/users/crmsdev/u96010/data/privacy_drone* not found

************************************************************************************************************

Could you please let me know why the functions are not invoked when a
user privbtch invokes the fucntion?


Thanks,
Kishore

4.Why IFS did not effect?

Hi,
   I write following scripts:

    IFS=",";set | grep "IFS"; for name in 0.01,0.02; do echo "$name";
done

   And its ouput is   "0.01,0.02", But I think it should be :
  0.01
  0.02

  The IFS variable take no effect. Could you please tell me why?
Thanks!

Regards!
Bo

5.pragma Pack does not work on GNAT 5.01a for Redhat Linux.

The Size of the following record is 112 on Linux, but 104 on Solaris.

type Something is record
   A : Packed_16;
   B : Packed_8;
   C : Packed_8;
   D : Packed_8;
   E : Packed_32;
   F : Packed_32;
end record;
pragma Pack (Something);

Where

type Packed_Byte is mod 2 **8;
for Packed_Byte'Size use 8;

type Packed_Bytes is array (Natural range <>) of Packed_Byte;
for Packed_Bytes'Alignment use 1;
for Packed_Bytes'Component_Size use Packed_Byte'Size;

type Packed_8 is new Packed_Bytes (0 .. 0);
for Packed_8'Size use 8;

and similar. Why is pragma Pack ignored?

TIA
/Petter

6. tcsetattr (on serial device) takes effect only at next application startup

7. PATH takes no effect when login

8. [News] Why Switch to GNU/Linux and Why Taking Market Share from Windows is Important



Return to unix

 

Who is online

Users browsing this forum: No registered users and 58 guest