file.c revision 9d6538abe73a4bdd28aa48313b013f201c6aed4c
1N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1N/Astatic long mklong_tab(int *);
static void sputl(long, char *);
int new_archive);
static int sizeofmembers();
static int sizeofnewarchive(int, int);
long *, ARFILEP **, int *);
#ifdef BROWSER
int fd;
return (fd);
return (fd);
pad(int n)
r = n % PADSZ;
r = PADSZ - r;
long extent;
long padding;
if (scn) {
if (t > extent)
extent = t;
} while (scn);
while (cnt--) {
padding = 0;
ARFILE *
return (NULL);
exit(0);
* See c block comment in cmd.c, "Incompatible Archive Header".
== NULL) {
PLAIN_ERROR, (char *)0);
== NULL) {
PLAIN_ERROR, (char *)0);
file_rawname++;
tmp_rawname++;
== NULL) {
if (ptr != 0) {
return (file);
ARFILE *
newfile(void)
static int count = 0;
if (count == 0) {
== NULL) {
PLAIN_ERROR, (char *)0);
count--;
if (listhead)
return (fileptr);
trimslash(char *s)
trim(char *s)
while (p1 > s) {
*p1 = 0;
p2 = s;
return (p2);
long mem_offset = 0;
int newfd;
long nsyms = 0;
int class = 0;
char *sbshstr;
char *sbshstrtp;
int num_errs = 0;
newfd = 0;
if ((newfd =
num_errs++;
(Elf *)0)) == 0) {
newfd = 0;
num_errs++;
PLAIN_ERROR, (char *)0,
PLAIN_ERROR, (char *)0);
if (newfd) {
newfd = 0;
PLAIN_ERROR, (char *)0);
num_errs++;
if (newfd) {
newfd = 0;
data = 0;
num_errs++;
if (newfd) {
newfd = 0;
PLAIN_ERROR, (char *)0,
PLAIN_ERROR, (char *)0);
if (newfd) {
newfd = 0;
num_errs++;
scn = 0;
if (newfd) {
newfd = 0;
num_errs++;
scn,
&nsyms,
if (newfd) {
newfd = 0;
#ifdef BROWSER
/* if (shdr.sh_name != 0) { */
sbshstrtp = (char *)
#ifdef BROWSER
elf,
mem_offset++;
if (newfd) {
newfd = 0;
if (num_errs)
return (nsyms);
long sym_tab_size = 0;
int sum = 0;
if (nsyms == 0)
j = SYMCHUNK;
if (nsyms != 0) {
*dst++ = 0;
if (pad_symtab) {
for (i = 0; i < pad_symtab; i++)
*dst++ = 0;
return (sum);
int diff;
diff = 0;
if (str_base == (char *)0) {
== NULL) {
PLAIN_ERROR, (char *)0);
p = str_top;
NULL) {
PLAIN_ERROR, (char *)0);
p += diff;
for (i = 0, s = symbol;
str_top = p;
int diff;
static int bytes_used;
int index;
diff = 0;
if (str_base1 == (char *)0) {
== NULL) {
PLAIN_ERROR, (char *)0);
p = str_top1;
== NULL) {
PLAIN_ERROR, (char *)0);
p += diff;
str_top1 = p;
int longnames = 0;
long long_tab_size = 0;
long nsyms;
int new_archive = 0;
int arsize;
char *dst;
char *tmp_dst;
int nfd;
int found_obj = 0;
for (i = 0; signum[i]; i++)
new_archive = 0;
int diff;
if (longnames) {
* See c block comment in cmd.c, "Incompatible Archive Header".
ARFMAG);
FILE *f;
if (f == NULL) {
(void) fclose(f);
tmp_dst++;
if (new_archive) {
#ifndef XPG4
PLAIN_ERROR, (char *)0,
if (!new_archive)
PLAIN_ERROR, (char *)0);
return (dst);
long ret = 0;
(*longnames)++;
if (*longnames) {
return (ret);
#ifdef BROWSER
char *stabstrtab;
char *stabstroff;
char *symname;
int prevstabstrsz;
PLAIN_ERROR, (char *)0);
PLAIN_ERROR, (char *)0);
PLAIN_ERROR, (char *)0);
data = 0;
PLAIN_ERROR, (char *)0);
data = 0;
PLAIN_ERROR, (char *)0);
prevstabstrsz = 0;
int counter;
int str_shtype;
char *symname;
static int syms_left = 0;
fname);
(*num_errs)++;
PLAIN_ERROR, (char *)0);
(*num_errs)++;
PLAIN_ERROR, (char *)0,
fname);
PLAIN_ERROR, (char *)0);
str_data = 0;
PLAIN_ERROR, (char *)0,
fname);
PLAIN_ERROR, (char *)0);
PLAIN_ERROR, (char *)0,
fname);
PLAIN_ERROR, (char *)0);
sym_data = 0;
if (!syms_left) {
* sizeof (ARFILEP));
PLAIN_ERROR, (char *)0);
if (nextsym)
nextsym++;
syms_left--;
(*nsyms)++;
int sum = 0;
sum++;
return (sum);
int sum = 0;
if (nsyms) {
top++;
if (longnames) {
return (sum);
int sum;
return (sum);
char *tmpname;
c = *slash;
*slash = 0;
*slash = c;
return (tmpname);
int saved;
if (fromfd < 0)
if (tofd < 0) {
if (nread < 0) {
int exists;
struct stat s;
int ret = 0;
if (ret == 0) {
if (exists) {
return (ret);
int arsize;
char *dst;
char *tmp_dst;
int nfd;
char *new_name;
FILE *f;
if (new_archive) {
int diff;
if (longnames) {
#ifndef XPG4
PLAIN_ERROR, (char *)0,
ARFMAG);
(void) fclose(f);
f = NULL;
if (f == NULL) {
PLAIN_ERROR, (char *)0);
(void) fclose(f);
if (!new_archive) {
return (dst);