equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
57 strcat(jniEntryName, "_"); |
57 strcat(jniEntryName, "_"); |
58 strcat(jniEntryName, cname); |
58 strcat(jniEntryName, cname); |
59 } |
59 } |
60 } |
60 } |
61 |
61 |
62 size_t |
62 JNIEXPORT size_t |
63 getLastErrorString(char *buf, size_t len) |
63 getLastErrorString(char *buf, size_t len) |
64 { |
64 { |
65 if (errno == 0 || len < 1) return 0; |
65 if (errno == 0 || len < 1) return 0; |
66 getErrorString(errno, buf, len); |
66 getErrorString(errno, buf, len); |
67 return strlen(buf); |
67 return strlen(buf); |
68 } |
68 } |
69 |
69 |
70 int |
70 JNIEXPORT int |
71 getErrorString(int err, char *buf, size_t len) |
71 getErrorString(int err, char *buf, size_t len) |
72 { |
72 { |
73 if (err == 0 || len < 1) return 0; |
73 if (err == 0 || len < 1) return 0; |
74 return strerror_r(err, buf, len); |
74 return strerror_r(err, buf, len); |
75 } |
75 } |