blob: 5e697eca9d512d4954c68159e5f84dc239531dcb [file] [log] [blame]
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001/*
2 * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
3 * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
4 * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
Wichert Akkerman4dc8a2a1999-12-23 14:20:14 +00005 * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00006 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. The name of the author may not be used to endorse or promote products
17 * derived from this software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000029 */
30
31#include "defs.h"
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000032#include <fcntl.h>
John Hughes1d08dcf2001-07-10 13:48:44 +000033#if HAVE_SYS_UIO_H
Denys Vlasenkoa6d91de2012-03-16 12:02:22 +010034# include <sys/uio.h>
John Hughes1d08dcf2001-07-10 13:48:44 +000035#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000036
37int
Dmitry V. Levin31382132011-03-04 05:08:02 +030038sys_read(struct tcb *tcp)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000039{
40 if (entering(tcp)) {
Dmitry V. Levin31382132011-03-04 05:08:02 +030041 printfd(tcp, tcp->u_arg[0]);
Denys Vlasenko60fe8c12011-09-01 10:00:28 +020042 tprints(", ");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000043 } else {
44 if (syserror(tcp))
45 tprintf("%#lx", tcp->u_arg[1]);
46 else
47 printstr(tcp, tcp->u_arg[1], tcp->u_rval);
48 tprintf(", %lu", tcp->u_arg[2]);
49 }
50 return 0;
51}
52
53int
Dmitry V. Levin31382132011-03-04 05:08:02 +030054sys_write(struct tcb *tcp)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000055{
56 if (entering(tcp)) {
Dmitry V. Levin31382132011-03-04 05:08:02 +030057 printfd(tcp, tcp->u_arg[0]);
Denys Vlasenko60fe8c12011-09-01 10:00:28 +020058 tprints(", ");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000059 printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
60 tprintf(", %lu", tcp->u_arg[2]);
61 }
62 return 0;
63}
64
John Hughes1d08dcf2001-07-10 13:48:44 +000065#if HAVE_SYS_UIO_H
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +000066void
Dmitry V. Levin88849682011-06-13 22:58:44 +000067tprint_iov(struct tcb *tcp, unsigned long len, unsigned long addr, int decode_iov)
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +000068{
Denys Vlasenko84703742012-02-25 02:38:52 +010069#if SUPPORTED_PERSONALITIES > 1
Dmitry V. Levin4ebb4e32006-12-13 17:08:08 +000070 union {
71 struct { u_int32_t base; u_int32_t len; } iov32;
72 struct { u_int64_t base; u_int64_t len; } iov64;
73 } iov;
74#define sizeof_iov \
Denys Vlasenko9fd4f962012-03-19 09:36:42 +010075 (current_wordsize == 4 ? sizeof(iov.iov32) : sizeof(iov.iov64))
Dmitry V. Levin4ebb4e32006-12-13 17:08:08 +000076#define iov_iov_base \
Denys Vlasenko9fd4f962012-03-19 09:36:42 +010077 (current_wordsize == 4 ? (uint64_t) iov.iov32.base : iov.iov64.base)
Dmitry V. Levin4ebb4e32006-12-13 17:08:08 +000078#define iov_iov_len \
Denys Vlasenko9fd4f962012-03-19 09:36:42 +010079 (current_wordsize == 4 ? (uint64_t) iov.iov32.len : iov.iov64.len)
Dmitry V. Levin4ebb4e32006-12-13 17:08:08 +000080#else
Roland McGrathaa524c82005-06-01 19:22:06 +000081 struct iovec iov;
Dmitry V. Levin4ebb4e32006-12-13 17:08:08 +000082#define sizeof_iov sizeof(iov)
83#define iov_iov_base iov.iov_base
84#define iov_iov_len iov.iov_len
85#endif
Roland McGrathaa524c82005-06-01 19:22:06 +000086 unsigned long size, cur, end, abbrev_end;
87 int failed = 0;
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +000088
89 if (!len) {
Denys Vlasenko60fe8c12011-09-01 10:00:28 +020090 tprints("[]");
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +000091 return;
92 }
Dmitry V. Levin4ebb4e32006-12-13 17:08:08 +000093 size = len * sizeof_iov;
Roland McGrathaa524c82005-06-01 19:22:06 +000094 end = addr + size;
Dmitry V. Levin4ebb4e32006-12-13 17:08:08 +000095 if (!verbose(tcp) || size / sizeof_iov != len || end < addr) {
Roland McGrathaa524c82005-06-01 19:22:06 +000096 tprintf("%#lx", addr);
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +000097 return;
98 }
Roland McGrathaa524c82005-06-01 19:22:06 +000099 if (abbrev(tcp)) {
Dmitry V. Levin4ebb4e32006-12-13 17:08:08 +0000100 abbrev_end = addr + max_strlen * sizeof_iov;
Roland McGrathaa524c82005-06-01 19:22:06 +0000101 if (abbrev_end < addr)
102 abbrev_end = end;
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +0000103 } else {
Roland McGrathaa524c82005-06-01 19:22:06 +0000104 abbrev_end = end;
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +0000105 }
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200106 tprints("[");
Dmitry V. Levin4ebb4e32006-12-13 17:08:08 +0000107 for (cur = addr; cur < end; cur += sizeof_iov) {
Roland McGrathaa524c82005-06-01 19:22:06 +0000108 if (cur > addr)
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200109 tprints(", ");
Roland McGrathaa524c82005-06-01 19:22:06 +0000110 if (cur >= abbrev_end) {
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200111 tprints("...");
Roland McGrathaa524c82005-06-01 19:22:06 +0000112 break;
113 }
Dmitry V. Levin4ebb4e32006-12-13 17:08:08 +0000114 if (umoven(tcp, cur, sizeof_iov, (char *) &iov) < 0) {
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200115 tprints("?");
Roland McGrathaa524c82005-06-01 19:22:06 +0000116 failed = 1;
117 break;
118 }
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200119 tprints("{");
Dmitry V. Levin88849682011-06-13 22:58:44 +0000120 if (decode_iov)
121 printstr(tcp, (long) iov_iov_base, iov_iov_len);
122 else
123 tprintf("%#lx", (long) iov_iov_base);
Dmitry V. Levin4ebb4e32006-12-13 17:08:08 +0000124 tprintf(", %lu}", (unsigned long)iov_iov_len);
Roland McGrathaa524c82005-06-01 19:22:06 +0000125 }
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200126 tprints("]");
Roland McGrathaa524c82005-06-01 19:22:06 +0000127 if (failed)
128 tprintf(" %#lx", addr);
Dmitry V. Levin4ebb4e32006-12-13 17:08:08 +0000129#undef sizeof_iov
130#undef iov_iov_base
131#undef iov_iov_len
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +0000132}
133
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000134int
Dmitry V. Levin31382132011-03-04 05:08:02 +0300135sys_readv(struct tcb *tcp)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000136{
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000137 if (entering(tcp)) {
Dmitry V. Levin31382132011-03-04 05:08:02 +0300138 printfd(tcp, tcp->u_arg[0]);
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200139 tprints(", ");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000140 } else {
141 if (syserror(tcp)) {
142 tprintf("%#lx, %lu",
143 tcp->u_arg[1], tcp->u_arg[2]);
144 return 0;
145 }
Dmitry V. Levin88849682011-06-13 22:58:44 +0000146 tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000147 tprintf(", %lu", tcp->u_arg[2]);
148 }
149 return 0;
150}
151
152int
Dmitry V. Levin31382132011-03-04 05:08:02 +0300153sys_writev(struct tcb *tcp)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000154{
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000155 if (entering(tcp)) {
Dmitry V. Levin31382132011-03-04 05:08:02 +0300156 printfd(tcp, tcp->u_arg[0]);
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200157 tprints(", ");
Dmitry V. Levin88849682011-06-13 22:58:44 +0000158 tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000159 tprintf(", %lu", tcp->u_arg[2]);
160 }
161 return 0;
162}
John Hughes1d08dcf2001-07-10 13:48:44 +0000163#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000164
Roland McGrathc0f8bbd2003-08-21 09:58:00 +0000165/* The SH4 ABI does allow long longs in odd-numbered registers, but
166 does not allow them to be split between registers and memory - and
167 there are only four argument registers for normal functions. As a
168 result pread takes an extra padding argument before the offset. This
169 was changed late in the 2.4 series (around 2.4.20). */
170#if defined(SH)
171#define PREAD_OFFSET_ARG 4
172#else
173#define PREAD_OFFSET_ARG 3
174#endif
175
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000176int
Dmitry V. Levin31382132011-03-04 05:08:02 +0300177sys_pread(struct tcb *tcp)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000178{
179 if (entering(tcp)) {
Dmitry V. Levin31382132011-03-04 05:08:02 +0300180 printfd(tcp, tcp->u_arg[0]);
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200181 tprints(", ");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000182 } else {
183 if (syserror(tcp))
184 tprintf("%#lx", tcp->u_arg[1]);
185 else
186 printstr(tcp, tcp->u_arg[1], tcp->u_rval);
Andreas Schwabb5600fc2009-11-04 17:08:34 +0100187 tprintf(", %lu, ", tcp->u_arg[2]);
188 printllval(tcp, "%llu", PREAD_OFFSET_ARG);
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000189 }
190 return 0;
191}
192
193int
Dmitry V. Levin31382132011-03-04 05:08:02 +0300194sys_pwrite(struct tcb *tcp)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000195{
196 if (entering(tcp)) {
Dmitry V. Levin31382132011-03-04 05:08:02 +0300197 printfd(tcp, tcp->u_arg[0]);
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200198 tprints(", ");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000199 printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
Andreas Schwabb5600fc2009-11-04 17:08:34 +0100200 tprintf(", %lu, ", tcp->u_arg[2]);
201 printllval(tcp, "%llu", PREAD_OFFSET_ARG);
Wichert Akkerman2e2553a1999-05-09 00:29:58 +0000202 }
203 return 0;
204}
205
Damir Shayhutdinov3087dd62011-05-12 16:57:40 +0400206#if HAVE_SYS_UIO_H
207int
208sys_preadv(struct tcb *tcp)
209{
210 if (entering(tcp)) {
211 printfd(tcp, tcp->u_arg[0]);
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200212 tprints(", ");
Damir Shayhutdinov3087dd62011-05-12 16:57:40 +0400213 } else {
214 if (syserror(tcp)) {
215 tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
216 return 0;
217 }
Dmitry V. Levin88849682011-06-13 22:58:44 +0000218 tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
Damir Shayhutdinov3087dd62011-05-12 16:57:40 +0400219 tprintf(", %lu, ", tcp->u_arg[2]);
220 printllval(tcp, "%llu", PREAD_OFFSET_ARG);
221 }
222 return 0;
223}
224
225int
226sys_pwritev(struct tcb *tcp)
227{
228 if (entering(tcp)) {
229 printfd(tcp, tcp->u_arg[0]);
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200230 tprints(", ");
Dmitry V. Levin88849682011-06-13 22:58:44 +0000231 tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
Damir Shayhutdinov3087dd62011-05-12 16:57:40 +0400232 tprintf(", %lu, ", tcp->u_arg[2]);
233 printllval(tcp, "%llu", PREAD_OFFSET_ARG);
234 }
235 return 0;
236}
237#endif /* HAVE_SYS_UIO_H */
238
Wichert Akkerman2e2553a1999-05-09 00:29:58 +0000239int
Dmitry V. Levin31382132011-03-04 05:08:02 +0300240sys_sendfile(struct tcb *tcp)
Wichert Akkerman2e2553a1999-05-09 00:29:58 +0000241{
242 if (entering(tcp)) {
243 off_t offset;
244
Dmitry V. Levin31382132011-03-04 05:08:02 +0300245 printfd(tcp, tcp->u_arg[0]);
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200246 tprints(", ");
Dmitry V. Levin31382132011-03-04 05:08:02 +0300247 printfd(tcp, tcp->u_arg[1]);
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200248 tprints(", ");
Wichert Akkerman2e2553a1999-05-09 00:29:58 +0000249 if (!tcp->u_arg[2])
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200250 tprints("NULL");
Wichert Akkerman2e2553a1999-05-09 00:29:58 +0000251 else if (umove(tcp, tcp->u_arg[2], &offset) < 0)
252 tprintf("%#lx", tcp->u_arg[2]);
253 else
H.J. Lu6ca26102012-02-03 10:12:10 -0800254#ifdef HAVE_LONG_LONG_OFF_T
255 tprintf("[%llu]", offset);
256#else
Wichert Akkerman2e2553a1999-05-09 00:29:58 +0000257 tprintf("[%lu]", offset);
H.J. Lu6ca26102012-02-03 10:12:10 -0800258#endif
Wichert Akkerman2e2553a1999-05-09 00:29:58 +0000259 tprintf(", %lu", tcp->u_arg[3]);
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000260 }
261 return 0;
262}
263
Mike Frysinger0cbed352012-04-04 22:22:01 -0400264void
Dmitry V. Levind99e48c2011-10-11 17:07:05 +0000265print_loff_t(struct tcb *tcp, long addr)
266{
267 loff_t offset;
268
269 if (!addr)
270 tprints("NULL");
271 else if (umove(tcp, addr, &offset) < 0)
272 tprintf("%#lx", addr);
273 else
274 tprintf("[%llu]", (unsigned long long int) offset);
275}
276
Roland McGrath186c5ac2002-12-15 23:58:23 +0000277int
Dmitry V. Levin31382132011-03-04 05:08:02 +0300278sys_sendfile64(struct tcb *tcp)
Roland McGrath186c5ac2002-12-15 23:58:23 +0000279{
280 if (entering(tcp)) {
Dmitry V. Levin31382132011-03-04 05:08:02 +0300281 printfd(tcp, tcp->u_arg[0]);
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200282 tprints(", ");
Dmitry V. Levin31382132011-03-04 05:08:02 +0300283 printfd(tcp, tcp->u_arg[1]);
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200284 tprints(", ");
Dmitry V. Levind99e48c2011-10-11 17:07:05 +0000285 print_loff_t(tcp, tcp->u_arg[2]);
Roland McGrath186c5ac2002-12-15 23:58:23 +0000286 tprintf(", %lu", tcp->u_arg[3]);
287 }
288 return 0;
289}
290
Dmitry V. Levind99e48c2011-10-11 17:07:05 +0000291static const struct xlat splice_flags[] = {
292#ifdef SPLICE_F_MOVE
293 { SPLICE_F_MOVE, "SPLICE_F_MOVE" },
294#endif
295#ifdef SPLICE_F_NONBLOCK
296 { SPLICE_F_NONBLOCK, "SPLICE_F_NONBLOCK" },
297#endif
298#ifdef SPLICE_F_MORE
299 { SPLICE_F_MORE, "SPLICE_F_MORE" },
300#endif
301#ifdef SPLICE_F_GIFT
302 { SPLICE_F_GIFT, "SPLICE_F_GIFT" },
303#endif
304 { 0, NULL },
305};
306
307int
308sys_tee(struct tcb *tcp)
309{
310 if (entering(tcp)) {
311 /* int fd_in */
312 printfd(tcp, tcp->u_arg[0]);
313 tprints(", ");
314 /* int fd_out */
315 printfd(tcp, tcp->u_arg[1]);
316 tprints(", ");
317 /* size_t len */
318 tprintf("%lu, ", tcp->u_arg[2]);
319 /* unsigned int flags */
320 printflags(splice_flags, tcp->u_arg[3], "SPLICE_F_???");
321 }
322 return 0;
323}
324
325int
326sys_splice(struct tcb *tcp)
327{
328 if (entering(tcp)) {
329 /* int fd_in */
330 printfd(tcp, tcp->u_arg[0]);
331 tprints(", ");
332 /* loff_t *off_in */
333 print_loff_t(tcp, tcp->u_arg[1]);
334 tprints(", ");
335 /* int fd_out */
336 printfd(tcp, tcp->u_arg[2]);
337 tprints(", ");
338 /* loff_t *off_out */
339 print_loff_t(tcp, tcp->u_arg[3]);
340 tprints(", ");
341 /* size_t len */
342 tprintf("%lu, ", tcp->u_arg[4]);
343 /* unsigned int flags */
344 printflags(splice_flags, tcp->u_arg[5], "SPLICE_F_???");
345 }
346 return 0;
347}
348
349int
350sys_vmsplice(struct tcb *tcp)
351{
352 if (entering(tcp)) {
353 /* int fd */
354 printfd(tcp, tcp->u_arg[0]);
355 tprints(", ");
356 /* const struct iovec *iov, unsigned long nr_segs */
357 tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
Dmitry V. Levin0bfd7442012-03-10 14:03:25 +0000358 tprintf(", %lu, ", tcp->u_arg[2]);
Dmitry V. Levind99e48c2011-10-11 17:07:05 +0000359 /* unsigned int flags */
360 printflags(splice_flags, tcp->u_arg[3], "SPLICE_F_???");
361 }
362 return 0;
363}
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000364
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000365int
Dmitry V. Levin31382132011-03-04 05:08:02 +0300366sys_ioctl(struct tcb *tcp)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000367{
Roland McGrathee36ce12004-09-04 03:53:10 +0000368 const struct ioctlent *iop;
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000369
370 if (entering(tcp)) {
Dmitry V. Levin31382132011-03-04 05:08:02 +0300371 printfd(tcp, tcp->u_arg[0]);
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200372 tprints(", ");
Roland McGrath2843a4e2003-11-14 02:54:03 +0000373 iop = ioctl_lookup(tcp->u_arg[1]);
374 if (iop) {
Denys Vlasenko5940e652011-09-01 09:55:05 +0200375 tprints(iop->symbol);
Roland McGrath2843a4e2003-11-14 02:54:03 +0000376 while ((iop = ioctl_next_match(iop)))
377 tprintf(" or %s", iop->symbol);
378 } else
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000379 tprintf("%#lx", tcp->u_arg[1]);
380 ioctl_decode(tcp, tcp->u_arg[1], tcp->u_arg[2]);
381 }
382 else {
Denys Vlasenko5d645812011-08-20 12:48:18 +0200383 int ret = ioctl_decode(tcp, tcp->u_arg[1], tcp->u_arg[2]);
384 if (!ret)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000385 tprintf(", %#lx", tcp->u_arg[2]);
John Hughes38ae88d2002-05-23 11:48:58 +0000386 else
387 return ret - 1;
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000388 }
389 return 0;
390}