]>
glassweightruler.freedombox.rocks Git - Ventoy.git/blob - SQUASHFS/squashfs-tools-4.4/squashfs-tools/unsquashfs_info.c
2 * Create a squashfs filesystem. This is a highly compressed read only
6 * Phillip Lougher <phillip@squashfs.org.uk>
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2,
11 * or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 #include <sys/ioctl.h>
36 #include <sys/types.h>
40 #include "squashfs_fs.h"
41 #include "unsquashfs.h"
44 static int silent
= 0;
45 char *pathname
= NULL
;
47 pthread_t info_thread
;
59 void update_info(char *name
)
70 disable_progress_bar();
72 printf("Queue and cache status dump\n");
73 printf("===========================\n");
75 printf("file buffer read queue (main thread -> reader thread)\n");
76 dump_queue(to_reader
);
78 printf("file buffer decompress queue (reader thread -> inflate"
80 dump_queue(to_inflate
);
82 printf("file buffer write queue (main thread -> writer thread)\n");
83 dump_queue(to_writer
);
85 printf("\nbuffer cache (uncompressed blocks and compressed blocks "
87 dump_cache(data_cache
);
89 printf("fragment buffer cache (uncompressed frags and compressed"
90 " frags 'in flight')\n");
91 dump_cache(fragment_cache
);
93 enable_progress_bar();
97 void *info_thrd(void *arg
)
100 struct timespec timespec
= { .tv_sec
= 1, .tv_nsec
= 0 };
101 int sig
, waiting
= 0;
103 sigemptyset(&sigmask
);
104 sigaddset(&sigmask
, SIGQUIT
);
105 sigaddset(&sigmask
, SIGHUP
);
109 sig
= sigtimedwait(&sigmask
, NULL
, ×pec
);
111 sig
= sigwaitinfo(&sigmask
, NULL
);
116 /* interval timed out */
120 /* if waiting, the wait will be longer, but
124 BAD_ERROR("sigtimedwait/sigwaitinfo failed "
125 "because %s\n", strerror(errno
));
129 if(sig
== SIGQUIT
&& !waiting
) {
131 INFO("%s\n", pathname
);
133 /* set one second interval period, if ^\ received
134 within then, dump queue and cache status */
144 pthread_create(&info_thread
, NULL
, info_thrd
, NULL
);