|
@@ -193,6 +193,18 @@ memset_user ( userptr_t buffer, off_t offset, int c, size_t len ) {
|
193
|
193
|
memset ( ( ( void * ) buffer + offset ), c, len );
|
194
|
194
|
}
|
195
|
195
|
|
|
196
|
+/**
|
|
197
|
+ * Find length of NUL-terminated string in user buffer
|
|
198
|
+ *
|
|
199
|
+ * @v buffer User buffer
|
|
200
|
+ * @v offset Offset within buffer
|
|
201
|
+ * @ret len Length of string (excluding NUL)
|
|
202
|
+ */
|
|
203
|
+static inline __attribute__ (( always_inline )) size_t
|
|
204
|
+strlen_user ( userptr_t buffer, off_t offset ) {
|
|
205
|
+ return strlen ( ( void * ) buffer + offset );
|
|
206
|
+}
|
|
207
|
+
|
196
|
208
|
/**
|
197
|
209
|
* Convert virtual address to user buffer
|
198
|
210
|
*
|