Hi!

-xarch=v9 � -xarch=native64 ���� � �� ��?

� v9 64-bit ��� ��������� ���������. ��� � �� ��� oops.

_sys_errlist and _sys_nerr ��� � 64-bit ������ ���������, ���������
������������ strerror_r.


Alexey Luckyanchikov wrote:
> 
> On Tue, 28 May 2002, Igor Khasilev wrote:
> 
> [...skip...]
> 
> IK> > cc -fast -xarch=native64 -xO3  -D_REENTRANT -DSOLARIS -mt -D_LARGEFILE_SOURCE 
>-D_FILE_OFFSET_BITS=64 -DWITH_LARGE_FILES -DHAVE_CONFIG_H oops.o lib.o run.o 
>run_client.o common.o http_utils.o ftp_utils.o  storage.o garbage_c.o  icp.o acl.o 
>y.tab.o lex.yy.o  rotate_logs.o clean_disk.o ssl.o list.o statistics.o  worker.o 
>dataq.o hash.o modules.o workq.o  gnu_regex.o modules/accel.o 
>modules/berkeley_db_api.o modules/gigabase_db_api.o modules/custom_log.o 
>modules/err.o modules/fastredir.o modules/lang.o modules/log_dummy.o 
>modules/oopsctl_mod.o modules/passwd_file.o modules/pam.o modules/passwd_mysql.o 
>modules/passwd_pgsql.o modules/redir.o modules/transparent.o modules/vary_header.o 
>modules/wccp2.o     -lm -ly -ll -lpam  -lsocket -lnsl   -o oops
> IK> > Undefined                       first referenced
> IK> >  symbol                             in file
> IK> > sys_nerr                            lib.o
> IK> > ld: fatal: Symbol referencing errors. No output written to oops
> IK> > *** Error code 1
> IK> >
> IK> > ���� sys_nerr ���� � libc.so.
> IK>
> IK> ����� ���� � ����?
> IK> $ nm /usr/lib/64/libc.so | grep sys_nerr
> IK> [208]   |        698968|           4|OBJT |LOCL |0    |13     |_sys_nerr
> IK> [354]   |        698968|           4|OBJT |LOCL |0    |13     |sys_nerr
> IK> $ nm /usr/lib/libc.so | grep sys_nerr
> IK> [3531]  |    667296|       4|OBJT |GLOB |0    |13     |_sys_nerr
> IK> [4367]  |    667296|       4|OBJT |WEAK |0    |13     |sys_nerr
> 
> ��. ������. ��� ��� � errno.h �������:
> #if defined(_LP64)
> /*
>  * The symbols _sys_errlist and _sys_nerr are not visible in the
>  * LP64 libc.  Use strerror(3C) instead.
>  */
> #endif /* _LP64 */
> 
> IK> > ���� �������� xarch �� native, �� ��� ���������� ��� �������.
> IK>
> IK> ��� ��� ��������� � ��� �������...
> 
> ��������� 32-������� ���.
> 
> IK> ���������� ������ �� ����� lib.c ������ �����
> IK>
> IK>     if (err < 0 || err >= sys_nerr) {
> IK>         snprintf(errbuf, lerrbuf, "Unknown error: (%d)", err);
> IK>         return(-1);
> IK>     }
> IK>     else
> 
> ��� ���, ��� �������, ��������:
> *** lib.c.orig  Tue May 28 20:29:01 2002
> --- lib.c       Tue May 28 20:49:19 2002
> ***************
> *** 1214,1226 ****
>   int
>   strerror_r(int err, char *errbuf, size_t lerrbuf)
>   {
>       if (err < 0 || err >= sys_nerr) {
>         snprintf(errbuf, lerrbuf, "Unknown error: (%d)", err);
>         return(-1);
>       }
> !     else
> !       strncpy(errbuf, strerror(err), lerrbuf);
> !       errbuf[lerrbuf-1] = 0;
>       return(0);
>   }
>   #endif        /* !HAVE_STRERROR_R && !_WIN32 */
> --- 1214,1234 ----
>   int
>   strerror_r(int err, char *errbuf, size_t lerrbuf)
>   {
> + #if   !defined(SOLARIS) || !defined(_LP64)
>       if (err < 0 || err >= sys_nerr) {
>         snprintf(errbuf, lerrbuf, "Unknown error: (%d)", err);
>         return(-1);
>       }
> !     strncpy(errbuf, strerror(err), lerrbuf);
> ! #else
> !     char *es = strerror(err);
> !     if (es == NULL) {
> !       snprintf(errbuf, lerrbuf, "Unknown error: (%d)", err);
> !       return(-1);
> !     }
> !     strncpy(errbuf, es, lerrbuf);
> ! #endif /* !SOLARIS || !_LP64 */
> !     errbuf[lerrbuf-1] = 0;
>       return(0);
>   }
>   #endif        /* !HAVE_STRERROR_R && !_WIN32 */
> 
> ����� ����� �������� � CVS?
> 
> --
> Sincerely,
> Alexey Luckyanchikov
> =====================================================================
> If you would like to unsubscribe from this list send message to
> [EMAIL PROTECTED] with "unsubscribe oops" in message body.
> Archive is accessible on http://lists.paco.net/oops-rus/

-- 
Andy Igoshin <[EMAIL PROTECTED]>
Phone: +7 0732 522406                    Voronezh State University
Fax:   +7 0732 789820                    Network Operation Center
CA:    http://noc.vsu.ru/ca/             Voronezh, Russia
=====================================================================
If you would like to unsubscribe from this list send message to
[EMAIL PROTECTED] with "unsubscribe oops" in message body.
Archive is accessible on http://lists.paco.net/oops-rus/

Дати відповідь електронним листом